From e1eef4e511ece4376a92d03638cc8dfe3602d9f2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 9 May 2022 12:12:28 +0000 Subject: [PATCH] CodeGen from PR 18749 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2022-03-01 (#18749) * Adds base for updating Microsoft.RecoveryServices from version stable/2022-02-01 to version 2022-03-01 * Updates readme * Updates API version in new specs and examples --- .../generated/api/Models/Any.cs | 34 + .../generated/api/Models/Any.json.cs | 104 + .../api/Models/Api10/ErrorAdditionalInfo.cs | 74 + .../Models/Api10/ErrorAdditionalInfo.json.cs | 114 + .../AzureBackupGoalFeatureSupportRequest.cs | 57 + ...ureBackupGoalFeatureSupportRequest.json.cs | 107 + .../Api20211201/AzureBackupServerContainer.cs | 118 + .../AzureBackupServerContainer.json.cs | 106 + .../Api20211201/AzureBackupServerEngine.cs | 139 + .../AzureBackupServerEngine.json.cs | 106 + .../AzureFileShareBackupRequest.cs | 76 + .../AzureFileShareBackupRequest.json.cs | 108 + .../AzureFileShareProtectableItem.cs | 130 + .../AzureFileShareProtectableItem.json.cs | 112 + .../AzureFileShareProtectionPolicy.cs | 171 + .../AzureFileShareProtectionPolicy.json.cs | 114 + .../AzureFileShareProvisionIlrRequest.cs | 95 + .../AzureFileShareProvisionIlrRequest.json.cs | 112 + .../AzureFileShareRecoveryPoint.cs | 133 + .../AzureFileShareRecoveryPoint.json.cs | 114 + .../AzureFileShareRestoreRequest.cs | 190 + .../AzureFileShareRestoreRequest.json.cs | 126 + .../AzureFileshareProtectedItem.cs | 319 + .../AzureFileshareProtectedItem.json.cs | 120 + ...AzureFileshareProtectedItemExtendedInfo.cs | 131 + ...FileshareProtectedItemExtendedInfo.json.cs | 122 + .../AzureFileshareProtectedItemKpisHealths.cs | 35 + ...hareProtectedItemKpisHealths.dictionary.cs | 75 + ...eFileshareProtectedItemKpisHealths.json.cs | 108 + .../AzureIaaSClassicComputeVmcontainer.cs | 98 + ...AzureIaaSClassicComputeVmcontainer.json.cs | 107 + ...zureIaaSClassicComputeVmprotectableItem.cs | 89 + ...aaSClassicComputeVmprotectableItem.json.cs | 108 + .../AzureIaaSClassicComputeVmprotectedItem.cs | 211 + ...eIaaSClassicComputeVmprotectedItem.json.cs | 107 + .../AzureIaaSComputeVmcontainer.cs | 100 + .../AzureIaaSComputeVmcontainer.json.cs | 108 + .../AzureIaaSComputeVmprotectableItem.cs | 89 + .../AzureIaaSComputeVmprotectableItem.json.cs | 108 + .../AzureIaaSComputeVmprotectedItem.cs | 213 + .../AzureIaaSComputeVmprotectedItem.json.cs | 108 + .../Api20211201/AzureIaaSvmErrorInfo.cs | 114 + .../Api20211201/AzureIaaSvmErrorInfo.json.cs | 132 + .../Api20211201/AzureIaaSvmHealthDetails.cs | 81 + .../AzureIaaSvmHealthDetails.json.cs | 106 + .../api/Models/Api20211201/AzureIaaSvmJob.cs | 285 + .../Models/Api20211201/AzureIaaSvmJob.json.cs | 136 + .../Api20211201/AzureIaaSvmJobExtendedInfo.cs | 136 + .../AzureIaaSvmJobExtendedInfo.json.cs | 124 + ...aaSvmJobExtendedInfoInternalPropertyBag.cs | 37 + ...endedInfoInternalPropertyBag.dictionary.cs | 75 + ...JobExtendedInfoInternalPropertyBag.json.cs | 110 + .../AzureIaaSvmJobExtendedInfoPropertyBag.cs | 35 + ...vmJobExtendedInfoPropertyBag.dictionary.cs | 75 + ...reIaaSvmJobExtendedInfoPropertyBag.json.cs | 108 + .../Api20211201/AzureIaaSvmJobTaskDetails.cs | 180 + .../AzureIaaSvmJobTaskDetails.json.cs | 120 + .../Models/Api20211201/AzureIaaSvmJobV2.cs | 268 + .../Api20211201/AzureIaaSvmJobV2.json.cs | 134 + .../Api20211201/AzureIaaSvmProtectedItem.cs | 448 + .../AzureIaaSvmProtectedItem.json.cs | 157 + .../AzureIaaSvmProtectedItemExtendedInfo.cs | 136 + ...ureIaaSvmProtectedItemExtendedInfo.json.cs | 117 + .../AzureIaaSvmProtectedItemKpisHealths.cs | 35 + ...aSvmProtectedItemKpisHealths.dictionary.cs | 75 + ...zureIaaSvmProtectedItemKpisHealths.json.cs | 108 + .../AzureIaaSvmProtectionPolicy.cs | 253 + .../AzureIaaSvmProtectionPolicy.json.cs | 120 + ...zureIaaSvmProtectionPolicyTieringPolicy.cs | 45 + ...rotectionPolicyTieringPolicy.dictionary.cs | 75 + ...aaSvmProtectionPolicyTieringPolicy.json.cs | 113 + ...ureRecoveryServiceVaultProtectionIntent.cs | 81 + ...coveryServiceVaultProtectionIntent.json.cs | 124 + .../AzureResourceProtectionIntent.cs | 96 + .../AzureResourceProtectionIntent.json.cs | 108 + .../Models/Api20211201/AzureSqlContainer.cs | 82 + .../Api20211201/AzureSqlContainer.json.cs | 106 + .../Api20211201/AzureSqlProtectedItem.cs | 217 + .../Api20211201/AzureSqlProtectedItem.json.cs | 112 + .../AzureSqlProtectedItemExtendedInfo.cs | 85 + .../AzureSqlProtectedItemExtendedInfo.json.cs | 110 + .../Api20211201/AzureSqlProtectionPolicy.cs | 99 + .../AzureSqlProtectionPolicy.json.cs | 108 + ...lagWorkloadContainerProtectionContainer.cs | 157 + ...rkloadContainerProtectionContainer.json.cs | 109 + .../Api20211201/AzureStorageContainer.cs | 167 + .../Api20211201/AzureStorageContainer.json.cs | 116 + .../Api20211201/AzureStorageErrorInfo.cs | 85 + .../Api20211201/AzureStorageErrorInfo.json.cs | 118 + .../api/Models/Api20211201/AzureStorageJob.cs | 249 + .../Api20211201/AzureStorageJob.json.cs | 136 + .../AzureStorageJobExtendedInfo.cs | 85 + .../AzureStorageJobExtendedInfo.json.cs | 118 + .../AzureStorageJobExtendedInfoPropertyBag.cs | 35 + ...geJobExtendedInfoPropertyBag.dictionary.cs | 75 + ...eStorageJobExtendedInfoPropertyBag.json.cs | 108 + .../Api20211201/AzureStorageJobTaskDetails.cs | 68 + .../AzureStorageJobTaskDetails.json.cs | 108 + .../AzureStorageProtectableContainer.cs | 77 + .../AzureStorageProtectableContainer.json.cs | 106 + ...AzureVMAppContainerProtectableContainer.cs | 77 + ...VMAppContainerProtectableContainer.json.cs | 108 + .../AzureVMAppContainerProtectionContainer.cs | 155 + ...eVMAppContainerProtectionContainer.json.cs | 107 + .../AzureVMResourceFeatureSupportRequest.cs | 91 + ...ureVMResourceFeatureSupportRequest.json.cs | 111 + .../AzureVMResourceFeatureSupportResponse.cs | 51 + ...reVMResourceFeatureSupportResponse.json.cs | 107 + .../Models/Api20211201/AzureVMWorkloadItem.cs | 158 + .../Api20211201/AzureVMWorkloadItem.json.cs | 151 + .../AzureVMWorkloadProtectableItem.cs | 256 + .../AzureVMWorkloadProtectableItem.json.cs | 158 + .../AzureVMWorkloadProtectedItem.cs | 489 + .../AzureVMWorkloadProtectedItem.json.cs | 155 + ...zureVMWorkloadProtectedItemExtendedInfo.cs | 155 + ...MWorkloadProtectedItemExtendedInfo.json.cs | 120 + ...AzureVMWorkloadProtectedItemKpisHealths.cs | 35 + ...loadProtectedItemKpisHealths.dictionary.cs | 75 + ...VMWorkloadProtectedItemKpisHealths.json.cs | 109 + .../AzureVMWorkloadProtectionPolicy.cs | 188 + .../AzureVMWorkloadProtectionPolicy.json.cs | 122 + ...reVMWorkloadSapAseDatabaseProtectedItem.cs | 228 + ...orkloadSapAseDatabaseProtectedItem.json.cs | 108 + ...ureVMWorkloadSapAseDatabaseWorkloadItem.cs | 95 + ...WorkloadSapAseDatabaseWorkloadItem.json.cs | 108 + ...reVMWorkloadSapAseSystemProtectableItem.cs | 122 + ...orkloadSapAseSystemProtectableItem.json.cs | 108 + ...AzureVMWorkloadSapAseSystemWorkloadItem.cs | 93 + ...VMWorkloadSapAseSystemWorkloadItem.json.cs | 108 + ...MWorkloadSapHanaDatabaseProtectableItem.cs | 122 + ...loadSapHanaDatabaseProtectableItem.json.cs | 109 + ...eVMWorkloadSapHanaDatabaseProtectedItem.cs | 228 + ...rkloadSapHanaDatabaseProtectedItem.json.cs | 108 + ...reVMWorkloadSapHanaDatabaseWorkloadItem.cs | 95 + ...orkloadSapHanaDatabaseWorkloadItem.json.cs | 108 + ...eVMWorkloadSapHanaSystemProtectableItem.cs | 122 + ...rkloadSapHanaSystemProtectableItem.json.cs | 108 + ...zureVMWorkloadSapHanaSystemWorkloadItem.cs | 95 + ...MWorkloadSapHanaSystemWorkloadItem.json.cs | 108 + ...loadSqlAvailabilityGroupProtectableItem.cs | 124 + ...qlAvailabilityGroupProtectableItem.json.cs | 111 + ...ureVMWorkloadSqlDatabaseProtectableItem.cs | 122 + ...WorkloadSqlDatabaseProtectableItem.json.cs | 108 + ...AzureVMWorkloadSqlDatabaseProtectedItem.cs | 226 + ...VMWorkloadSqlDatabaseProtectedItem.json.cs | 108 + .../AzureVMWorkloadSqlDatabaseWorkloadItem.cs | 93 + ...eVMWorkloadSqlDatabaseWorkloadItem.json.cs | 107 + ...ureVMWorkloadSqlInstanceProtectableItem.cs | 122 + ...WorkloadSqlInstanceProtectableItem.json.cs | 108 + .../AzureVMWorkloadSqlInstanceWorkloadItem.cs | 110 + ...eVMWorkloadSqlInstanceWorkloadItem.json.cs | 117 + .../AzureWorkloadAutoProtectionIntent.cs | 79 + .../AzureWorkloadAutoProtectionIntent.json.cs | 106 + .../Api20211201/AzureWorkloadBackupRequest.cs | 110 + .../AzureWorkloadBackupRequest.json.cs | 112 + .../Api20211201/AzureWorkloadContainer.cs | 305 + .../AzureWorkloadContainer.json.cs | 135 + ...reWorkloadContainerAutoProtectionIntent.cs | 81 + ...kloadContainerAutoProtectionIntent.json.cs | 108 + .../AzureWorkloadContainerExtendedInfo.cs | 190 + ...AzureWorkloadContainerExtendedInfo.json.cs | 119 + .../Api20211201/AzureWorkloadErrorInfo.cs | 119 + .../AzureWorkloadErrorInfo.json.cs | 122 + .../Models/Api20211201/AzureWorkloadJob.cs | 209 + .../Api20211201/AzureWorkloadJob.json.cs | 132 + .../AzureWorkloadJobExtendedInfo.cs | 85 + .../AzureWorkloadJobExtendedInfo.json.cs | 118 + ...AzureWorkloadJobExtendedInfoPropertyBag.cs | 35 + ...adJobExtendedInfoPropertyBag.dictionary.cs | 75 + ...WorkloadJobExtendedInfoPropertyBag.json.cs | 109 + .../AzureWorkloadJobTaskDetails.cs | 68 + .../AzureWorkloadJobTaskDetails.json.cs | 108 + .../AzureWorkloadPointInTimeRecoveryPoint.cs | 92 + ...reWorkloadPointInTimeRecoveryPoint.json.cs | 133 + .../AzureWorkloadPointInTimeRestoreRequest.cs | 123 + ...eWorkloadPointInTimeRestoreRequest.json.cs | 111 + .../Api20211201/AzureWorkloadRecoveryPoint.cs | 129 + .../AzureWorkloadRecoveryPoint.json.cs | 155 + ...eWorkloadRecoveryPointMoveReadinessInfo.cs | 37 + ...coveryPointMoveReadinessInfo.dictionary.cs | 75 + ...loadRecoveryPointMoveReadinessInfo.json.cs | 109 + .../AzureWorkloadRestoreRequest.cs | 228 + .../AzureWorkloadRestoreRequest.json.cs | 165 + .../AzureWorkloadRestoreRequestPropertyBag.cs | 35 + ...oadRestoreRequestPropertyBag.dictionary.cs | 75 + ...eWorkloadRestoreRequestPropertyBag.json.cs | 108 + ...WorkloadSapHanaPointInTimeRecoveryPoint.cs | 81 + ...oadSapHanaPointInTimeRecoveryPoint.json.cs | 109 + ...orkloadSapHanaPointInTimeRestoreRequest.cs | 125 + ...adSapHanaPointInTimeRestoreRequest.json.cs | 129 + ...aPointInTimeRestoreWithRehydrateRequest.cs | 162 + ...tInTimeRestoreWithRehydrateRequest.json.cs | 113 + .../AzureWorkloadSapHanaRecoveryPoint.cs | 77 + .../AzureWorkloadSapHanaRecoveryPoint.json.cs | 108 + .../AzureWorkloadSapHanaRestoreRequest.cs | 104 + ...AzureWorkloadSapHanaRestoreRequest.json.cs | 107 + ...kloadSapHanaRestoreWithRehydrateRequest.cs | 158 + ...SapHanaRestoreWithRehydrateRequest.json.cs | 113 + .../AzureWorkloadSqlAutoProtectionIntent.cs | 96 + ...ureWorkloadSqlAutoProtectionIntent.json.cs | 109 + ...zureWorkloadSqlPointInTimeRecoveryPoint.cs | 110 + ...orkloadSqlPointInTimeRecoveryPoint.json.cs | 118 + ...ureWorkloadSqlPointInTimeRestoreRequest.cs | 139 + ...rkloadSqlPointInTimeRestoreRequest.json.cs | 126 + ...lPointInTimeRestoreWithRehydrateRequest.cs | 178 + ...tInTimeRestoreWithRehydrateRequest.json.cs | 113 + .../AzureWorkloadSqlRecoveryPoint.cs | 125 + .../AzureWorkloadSqlRecoveryPoint.json.cs | 126 + ...ureWorkloadSqlRecoveryPointExtendedInfo.cs | 70 + ...rkloadSqlRecoveryPointExtendedInfo.json.cs | 118 + .../AzureWorkloadSqlRestoreRequest.cs | 167 + .../AzureWorkloadSqlRestoreRequest.json.cs | 144 + ...eWorkloadSqlRestoreWithRehydrateRequest.cs | 174 + ...loadSqlRestoreWithRehydrateRequest.json.cs | 112 + .../Models/Api20211201/BackupEngineBase.cs | 370 + .../Api20211201/BackupEngineBase.json.cs | 151 + .../Api20211201/BackupEngineBaseResource.cs | 393 + .../BackupEngineBaseResource.json.cs | 110 + .../BackupEngineBaseResourceList.cs | 76 + .../BackupEngineBaseResourceList.json.cs | 116 + .../Api20211201/BackupEngineExtendedInfo.cs | 170 + .../BackupEngineExtendedInfo.json.cs | 120 + .../Api20211201/BackupManagementUsage.cs | 159 + .../Api20211201/BackupManagementUsage.json.cs | 116 + .../Api20211201/BackupManagementUsageList.cs | 51 + .../BackupManagementUsageList.json.cs | 114 + .../api/Models/Api20211201/BackupRequest.cs | 59 + .../Models/Api20211201/BackupRequest.json.cs | 131 + .../Api20211201/BackupRequestResource.cs | 122 + .../Api20211201/BackupRequestResource.json.cs | 110 + .../Api20211201/BackupResourceConfig.cs | 142 + .../Api20211201/BackupResourceConfig.json.cs | 116 + .../BackupResourceConfigResource.cs | 190 + .../BackupResourceConfigResource.json.cs | 108 + .../BackupResourceEncryptionConfig.cs | 114 + .../BackupResourceEncryptionConfig.json.cs | 113 + .../BackupResourceEncryptionConfigExtended.cs | 102 + ...upResourceEncryptionConfigExtended.json.cs | 110 + ...esourceEncryptionConfigExtendedResource.cs | 195 + ...ceEncryptionConfigExtendedResource.json.cs | 110 + .../BackupResourceEncryptionConfigResource.cs | 165 + ...upResourceEncryptionConfigResource.json.cs | 108 + .../Api20211201/BackupResourceVaultConfig.cs | 159 + .../BackupResourceVaultConfig.json.cs | 126 + .../BackupResourceVaultConfigResource.cs | 204 + .../BackupResourceVaultConfigResource.json.cs | 108 + .../Models/Api20211201/BackupStatusRequest.cs | 85 + .../Api20211201/BackupStatusRequest.json.cs | 110 + .../Api20211201/BackupStatusResponse.cs | 193 + .../Api20211201/BackupStatusResponse.json.cs | 122 + .../api/Models/Api20211201/BekDetails.cs | 85 + .../api/Models/Api20211201/BekDetails.json.cs | 110 + .../Api20211201/BmsBackupEngineQueryObject.cs | 51 + .../BmsBackupEngineQueryObject.json.cs | 106 + .../BmsBackupEnginesQueryObject.cs | 85 + .../BmsBackupEnginesQueryObject.json.cs | 110 + .../BmsBackupSummariesQueryObject.cs | 51 + .../BmsBackupSummariesQueryObject.json.cs | 106 + .../Api20211201/BmsContainerQueryObject.cs | 136 + .../BmsContainerQueryObject.json.cs | 116 + .../BmsContainersInquiryQueryObject.cs | 68 + .../BmsContainersInquiryQueryObject.json.cs | 108 + .../BmsRefreshContainersQueryObject.cs | 51 + .../BmsRefreshContainersQueryObject.json.cs | 106 + .../Api20211201/BmsWorkloadItemQueryObject.cs | 102 + .../BmsWorkloadItemQueryObject.json.cs | 112 + .../Models/Api20211201/BmspoQueryObject.cs | 119 + .../Api20211201/BmspoQueryObject.json.cs | 114 + .../Models/Api20211201/BmsrpQueryObject.cs | 125 + .../Api20211201/BmsrpQueryObject.json.cs | 114 + .../Api20211201/ClientDiscoveryDisplay.cs | 102 + .../ClientDiscoveryDisplay.json.cs | 112 + .../ClientDiscoveryForLogSpecification.cs | 85 + ...ClientDiscoveryForLogSpecification.json.cs | 111 + .../ClientDiscoveryForProperties.cs | 60 + .../ClientDiscoveryForProperties.json.cs | 106 + .../ClientDiscoveryForServiceSpecification.cs | 51 + ...ntDiscoveryForServiceSpecification.json.cs | 115 + .../Api20211201/ClientDiscoveryResponse.cs | 68 + .../ClientDiscoveryResponse.json.cs | 116 + .../ClientDiscoveryValueForSingleApi.cs | 173 + .../ClientDiscoveryValueForSingleApi.json.cs | 112 + .../Api20211201/ClientScriptForConnect.cs | 147 + .../ClientScriptForConnect.json.cs | 114 + .../api/Models/Api20211201/CloudError.cs | 149 + .../api/Models/Api20211201/CloudError.json.cs | 106 + .../api/Models/Api20211201/CloudErrorBody.cs | 152 + .../Models/Api20211201/CloudErrorBody.json.cs | 145 + .../Api20211201/ContainerIdentityInfo.cs | 102 + .../Api20211201/ContainerIdentityInfo.json.cs | 112 + .../Api20211201/DailyRetentionFormat.cs | 51 + .../Api20211201/DailyRetentionFormat.json.cs | 114 + .../Api20211201/DailyRetentionSchedule.cs | 101 + .../DailyRetentionSchedule.json.cs | 116 + .../api/Models/Api20211201/DailySchedule.cs | 48 + .../Models/Api20211201/DailySchedule.json.cs | 113 + .../generated/api/Models/Api20211201/Day.cs | 68 + .../api/Models/Api20211201/Day.json.cs | 108 + .../Api20211201/DiskExclusionProperties.cs | 65 + .../DiskExclusionProperties.json.cs | 115 + .../api/Models/Api20211201/DiskInformation.cs | 64 + .../Api20211201/DiskInformation.json.cs | 108 + .../Api20211201/DistributedNodesInfo.cs | 141 + .../Api20211201/DistributedNodesInfo.json.cs | 110 + .../api/Models/Api20211201/DpmBackupEngine.cs | 139 + .../Api20211201/DpmBackupEngine.json.cs | 106 + .../api/Models/Api20211201/DpmContainer.cs | 227 + .../Models/Api20211201/DpmContainer.json.cs | 145 + .../Api20211201/DpmContainerExtendedInfo.cs | 51 + .../DpmContainerExtendedInfo.json.cs | 106 + .../api/Models/Api20211201/DpmErrorInfo.cs | 68 + .../Models/Api20211201/DpmErrorInfo.json.cs | 116 + .../api/Models/Api20211201/DpmJob.cs | 260 + .../api/Models/Api20211201/DpmJob.json.cs | 138 + .../Models/Api20211201/DpmJobExtendedInfo.cs | 85 + .../Api20211201/DpmJobExtendedInfo.json.cs | 118 + .../DpmJobExtendedInfoPropertyBag.cs | 35 + ...pmJobExtendedInfoPropertyBag.dictionary.cs | 75 + .../DpmJobExtendedInfoPropertyBag.json.cs | 107 + .../Models/Api20211201/DpmJobTaskDetails.cs | 119 + .../Api20211201/DpmJobTaskDetails.json.cs | 114 + .../Models/Api20211201/DpmProtectedItem.cs | 382 + .../Api20211201/DpmProtectedItem.json.cs | 114 + .../DpmProtectedItemExtendedInfo.cs | 272 + .../DpmProtectedItemExtendedInfo.json.cs | 132 + ...emExtendedInfoProtectableObjectLoadPath.cs | 37 + ...nfoProtectableObjectLoadPath.dictionary.cs | 75 + ...endedInfoProtectableObjectLoadPath.json.cs | 110 + .../Models/Api20211201/EncryptionDetails.cs | 125 + .../Api20211201/EncryptionDetails.json.cs | 114 + .../api/Models/Api20211201/ErrorDetail.cs | 94 + .../Models/Api20211201/ErrorDetail.json.cs | 127 + .../ExportJobsOperationResultInfo.cs | 127 + .../ExportJobsOperationResultInfo.json.cs | 114 + .../Models/Api20211201/ExtendedProperties.cs | 91 + .../Api20211201/ExtendedProperties.json.cs | 108 + .../Api20211201/FeatureSupportRequest.cs | 51 + .../Api20211201/FeatureSupportRequest.json.cs | 125 + .../Models/Api20211201/GenericContainer.cs | 200 + .../Api20211201/GenericContainer.json.cs | 110 + .../GenericContainerExtendedInfo.cs | 136 + .../GenericContainerExtendedInfo.json.cs | 110 + ...icContainerExtendedInfoServiceEndpoints.cs | 37 + ...ExtendedInfoServiceEndpoints.dictionary.cs | 75 + ...tainerExtendedInfoServiceEndpoints.json.cs | 110 + .../Api20211201/GenericProtectedItem.cs | 231 + .../Api20211201/GenericProtectedItem.json.cs | 118 + .../GenericProtectedItemSourceAssociations.cs | 37 + ...tectedItemSourceAssociations.dictionary.cs | 75 + ...ricProtectedItemSourceAssociations.json.cs | 110 + .../Api20211201/GenericProtectionPolicy.cs | 124 + .../GenericProtectionPolicy.json.cs | 120 + .../Api20211201/GenericRecoveryPoint.cs | 127 + .../Api20211201/GenericRecoveryPoint.json.cs | 114 + .../GetProtectedItemQueryObject.cs | 51 + .../GetProtectedItemQueryObject.json.cs | 106 + .../api/Models/Api20211201/HourlySchedule.cs | 92 + .../Models/Api20211201/HourlySchedule.json.cs | 109 + .../api/Models/Api20211201/IaaSvmContainer.cs | 145 + .../Api20211201/IaaSvmContainer.json.cs | 131 + .../Api20211201/IaaSvmProtectableItem.cs | 130 + .../Api20211201/IaaSvmProtectableItem.json.cs | 131 + .../Models/Api20211201/IaasVMBackupRequest.cs | 76 + .../Api20211201/IaasVMBackupRequest.json.cs | 108 + .../Models/Api20211201/IaasVMRecoveryPoint.cs | 478 + .../Api20211201/IaasVMRecoveryPoint.json.cs | 152 + .../IaasVMRecoveryPointMoveReadinessInfo.cs | 35 + ...coveryPointMoveReadinessInfo.dictionary.cs | 75 + ...asVMRecoveryPointMoveReadinessInfo.json.cs | 108 + .../Api20211201/IaasVMRestoreRequest.cs | 608 + .../Api20211201/IaasVMRestoreRequest.json.cs | 177 + .../IaasVMRestoreWithRehydrationRequest.cs | 257 + ...aasVMRestoreWithRehydrationRequest.json.cs | 111 + .../IaasVmilrRegistrationRequest.cs | 133 + .../IaasVmilrRegistrationRequest.json.cs | 114 + .../IdentityBasedRestoreDetails.cs | 68 + .../IdentityBasedRestoreDetails.json.cs | 108 + .../api/Models/Api20211201/IdentityInfo.cs | 78 + .../Models/Api20211201/IdentityInfo.json.cs | 108 + .../api/Models/Api20211201/IlrRequest.cs | 57 + .../api/Models/Api20211201/IlrRequest.json.cs | 125 + .../Models/Api20211201/IlrRequestResource.cs | 120 + .../Api20211201/IlrRequestResource.json.cs | 108 + .../api/Models/Api20211201/InquiryInfo.cs | 151 + .../Models/Api20211201/InquiryInfo.json.cs | 118 + .../Models/Api20211201/InquiryValidation.cs | 134 + .../Api20211201/InquiryValidation.json.cs | 113 + .../Api20211201/InstantItemRecoveryTarget.cs | 51 + .../InstantItemRecoveryTarget.json.cs | 114 + .../Api20211201/InstantRpAdditionalDetails.cs | 61 + .../InstantRpAdditionalDetails.json.cs | 107 + .../generated/api/Models/Api20211201/Job.cs | 176 + .../api/Models/Api20211201/Job.json.cs | 159 + .../api/Models/Api20211201/JobQueryObject.cs | 136 + .../Models/Api20211201/JobQueryObject.json.cs | 116 + .../api/Models/Api20211201/JobResource.cs | 218 + .../Models/Api20211201/JobResource.json.cs | 108 + .../api/Models/Api20211201/JobResourceList.cs | 76 + .../Api20211201/JobResourceList.json.cs | 116 + .../api/Models/Api20211201/KekDetails.cs | 85 + .../api/Models/Api20211201/KekDetails.json.cs | 110 + .../Models/Api20211201/KeyAndSecretDetails.cs | 179 + .../Api20211201/KeyAndSecretDetails.json.cs | 118 + .../Api20211201/KpiResourceHealthDetails.cs | 68 + .../KpiResourceHealthDetails.json.cs | 116 + ...RecoveryPointsRecommendedForMoveRequest.cs | 70 + ...eryPointsRecommendedForMoveRequest.json.cs | 118 + .../Models/Api20211201/LogSchedulePolicy.cs | 76 + .../Api20211201/LogSchedulePolicy.json.cs | 108 + .../Api20211201/LongTermRetentionPolicy.cs | 495 + .../LongTermRetentionPolicy.json.cs | 114 + .../Api20211201/LongTermSchedulePolicy.cs | 59 + .../LongTermSchedulePolicy.json.cs | 106 + .../api/Models/Api20211201/MabContainer.cs | 266 + .../Models/Api20211201/MabContainer.json.cs | 128 + .../Api20211201/MabContainerExtendedInfo.cs | 119 + .../MabContainerExtendedInfo.json.cs | 122 + .../Api20211201/MabContainerHealthDetails.cs | 102 + .../MabContainerHealthDetails.json.cs | 120 + .../api/Models/Api20211201/MabErrorInfo.cs | 74 + .../Models/Api20211201/MabErrorInfo.json.cs | 122 + .../Api20211201/MabFileFolderProtectedItem.cs | 279 + .../MabFileFolderProtectedItem.json.cs | 120 + .../MabFileFolderProtectedItemExtendedInfo.cs | 85 + ...ileFolderProtectedItemExtendedInfo.json.cs | 111 + .../api/Models/Api20211201/MabJob.cs | 243 + .../api/Models/Api20211201/MabJob.json.cs | 136 + .../Models/Api20211201/MabJobExtendedInfo.cs | 85 + .../Api20211201/MabJobExtendedInfo.json.cs | 118 + .../MabJobExtendedInfoPropertyBag.cs | 35 + ...abJobExtendedInfoPropertyBag.dictionary.cs | 75 + .../MabJobExtendedInfoPropertyBag.json.cs | 107 + .../Models/Api20211201/MabJobTaskDetails.cs | 119 + .../Api20211201/MabJobTaskDetails.json.cs | 114 + .../Models/Api20211201/MabProtectionPolicy.cs | 131 + .../Api20211201/MabProtectionPolicy.json.cs | 110 + .../Api20211201/MonthlyRetentionSchedule.cs | 184 + .../MonthlyRetentionSchedule.json.cs | 122 + .../Api20211201/MoveRpAcrossTiersRequest.cs | 82 + .../MoveRpAcrossTiersRequest.json.cs | 109 + .../api/Models/Api20211201/NameInfo.cs | 68 + .../api/Models/Api20211201/NameInfo.json.cs | 108 + .../Models/Api20211201/NewErrorResponse.cs | 131 + .../Api20211201/NewErrorResponse.json.cs | 106 + .../Api20211201/NewErrorResponseError.cs | 134 + .../Api20211201/NewErrorResponseError.json.cs | 145 + .../Models/Api20211201/OperationResultInfo.cs | 76 + .../Api20211201/OperationResultInfo.json.cs | 116 + .../Api20211201/OperationResultInfoBase.cs | 57 + .../OperationResultInfoBase.json.cs | 125 + .../OperationResultInfoBaseResource.cs | 93 + .../OperationResultInfoBaseResource.json.cs | 108 + .../api/Models/Api20211201/OperationStatus.cs | 191 + .../Api20211201/OperationStatus.json.cs | 118 + .../Api20211201/OperationStatusError.cs | 68 + .../Api20211201/OperationStatusError.json.cs | 108 + .../OperationStatusExtendedInfo.cs | 57 + .../OperationStatusExtendedInfo.json.cs | 133 + .../OperationStatusJobExtendedInfo.cs | 76 + .../OperationStatusJobExtendedInfo.json.cs | 108 + .../OperationStatusJobsExtendedInfo.cs | 93 + .../OperationStatusJobsExtendedInfo.json.cs | 118 + ...onStatusJobsExtendedInfoFailedJobsError.cs | 37 + ...sExtendedInfoFailedJobsError.dictionary.cs | 75 + ...tusJobsExtendedInfoFailedJobsError.json.cs | 110 + ...OperationStatusProvisionIlrExtendedInfo.cs | 85 + ...tionStatusProvisionIlrExtendedInfo.json.cs | 110 + ...tionStatusValidateOperationExtendedInfo.cs | 87 + ...tatusValidateOperationExtendedInfo.json.cs | 111 + .../Api20211201/OperationWorkerResponse.cs | 68 + .../OperationWorkerResponse.json.cs | 108 + .../OperationWorkerResponseHeaders.cs | 35 + ...erationWorkerResponseHeaders.dictionary.cs | 75 + .../OperationWorkerResponseHeaders.json.cs | 107 + .../Models/Api20211201/PointInTimeRange.cs | 68 + .../Api20211201/PointInTimeRange.json.cs | 108 + .../Models/Api20211201/PreBackupValidation.cs | 85 + .../Api20211201/PreBackupValidation.json.cs | 110 + .../PreValidateEnableBackupRequest.cs | 116 + .../PreValidateEnableBackupRequest.json.cs | 118 + .../PreValidateEnableBackupResponse.cs | 152 + .../PreValidateEnableBackupResponse.json.cs | 116 + .../Api20211201/PrepareDataMoveRequest.cs | 129 + .../PrepareDataMoveRequest.json.cs | 122 + .../Api20211201/PrepareDataMoveResponse.cs | 93 + .../PrepareDataMoveResponse.json.cs | 110 + ...reDataMoveResponseSourceVaultProperties.cs | 37 + ...esponseSourceVaultProperties.dictionary.cs | 75 + ...aMoveResponseSourceVaultProperties.json.cs | 110 + .../api/Models/Api20211201/PrivateEndpoint.cs | 53 + .../Api20211201/PrivateEndpoint.json.cs | 108 + .../Api20211201/PrivateEndpointConnection.cs | 131 + .../PrivateEndpointConnection.json.cs | 110 + .../PrivateEndpointConnectionResource.cs | 180 + .../PrivateEndpointConnectionResource.json.cs | 108 + .../PrivateLinkServiceConnectionState.cs | 85 + .../PrivateLinkServiceConnectionState.json.cs | 110 + .../Api20211201/ProtectableContainer.cs | 133 + .../Api20211201/ProtectableContainer.json.cs | 133 + .../ProtectableContainerResource.cs | 184 + .../ProtectableContainerResource.json.cs | 108 + .../ProtectableContainerResourceList.cs | 76 + .../ProtectableContainerResourceList.json.cs | 116 + .../api/Models/Api20211201/ProtectedItem.cs | 329 + .../Models/Api20211201/ProtectedItem.json.cs | 205 + .../Api20211201/ProtectedItemQueryObject.cs | 187 + .../ProtectedItemQueryObject.json.cs | 122 + .../Api20211201/ProtectedItemResource.cs | 344 + .../Api20211201/ProtectedItemResource.json.cs | 108 + .../Api20211201/ProtectedItemResourceList.cs | 76 + .../ProtectedItemResourceList.json.cs | 116 + .../Models/Api20211201/ProtectionContainer.cs | 156 + .../Api20211201/ProtectionContainer.json.cs | 177 + .../ProtectionContainerResource.cs | 204 + .../ProtectionContainerResource.json.cs | 110 + .../ProtectionContainerResourceList.cs | 76 + .../ProtectionContainerResourceList.json.cs | 116 + .../Models/Api20211201/ProtectionIntent.cs | 142 + .../Api20211201/ProtectionIntent.json.cs | 147 + .../ProtectionIntentQueryObject.cs | 102 + .../ProtectionIntentQueryObject.json.cs | 112 + .../Api20211201/ProtectionIntentResource.cs | 190 + .../ProtectionIntentResource.json.cs | 108 + .../ProtectionIntentResourceList.cs | 76 + .../ProtectionIntentResourceList.json.cs | 116 + .../Models/Api20211201/ProtectionPolicy.cs | 93 + .../Api20211201/ProtectionPolicy.json.cs | 155 + .../ProtectionPolicyQueryObject.cs | 85 + .../ProtectionPolicyQueryObject.json.cs | 110 + .../Api20211201/ProtectionPolicyResource.cs | 150 + .../ProtectionPolicyResource.json.cs | 110 + .../ProtectionPolicyResourceList.cs | 76 + .../ProtectionPolicyResourceList.json.cs | 116 + .../api/Models/Api20211201/RecoveryPoint.cs | 59 + .../Models/Api20211201/RecoveryPoint.json.cs | 155 + .../RecoveryPointDiskConfiguration.cs | 102 + .../RecoveryPointDiskConfiguration.json.cs | 128 + .../RecoveryPointMoveReadinessInfo.cs | 61 + .../RecoveryPointMoveReadinessInfo.json.cs | 107 + .../RecoveryPointRehydrationInfo.cs | 78 + .../RecoveryPointRehydrationInfo.json.cs | 108 + .../Api20211201/RecoveryPointResource.cs | 122 + .../Api20211201/RecoveryPointResource.json.cs | 110 + .../Api20211201/RecoveryPointResourceList.cs | 76 + .../RecoveryPointResourceList.json.cs | 116 + .../RecoveryPointTierInformation.cs | 85 + .../RecoveryPointTierInformation.json.cs | 110 + ...ecoveryPointTierInformationExtendedInfo.cs | 37 + ...tTierInformationExtendedInfo.dictionary.cs | 75 + ...ryPointTierInformationExtendedInfo.json.cs | 109 + .../RecoveryPointTierInformationV2.cs | 65 + .../RecoveryPointTierInformationV2.json.cs | 106 + .../api/Models/Api20211201/Resource.cs | 151 + .../api/Models/Api20211201/Resource.json.cs | 125 + .../ResourceGuardOperationDetail.cs | 61 + .../ResourceGuardOperationDetail.json.cs | 107 + .../Api20211201/ResourceGuardProxyBase.cs | 93 + .../ResourceGuardProxyBase.json.cs | 119 + .../ResourceGuardProxyBaseResource.cs | 147 + .../ResourceGuardProxyBaseResource.json.cs | 107 + .../ResourceGuardProxyBaseResourceList.cs | 76 + ...ResourceGuardProxyBaseResourceList.json.cs | 117 + .../Api20211201/ResourceHealthDetails.cs | 114 + .../Api20211201/ResourceHealthDetails.json.cs | 132 + .../api/Models/Api20211201/ResourceList.cs | 57 + .../Models/Api20211201/ResourceList.json.cs | 106 + .../api/Models/Api20211201/ResourceTags.cs | 35 + .../Api20211201/ResourceTags.dictionary.cs | 75 + .../Models/Api20211201/ResourceTags.json.cs | 107 + .../Models/Api20211201/RestoreFileSpecs.cs | 85 + .../Api20211201/RestoreFileSpecs.json.cs | 110 + .../api/Models/Api20211201/RestoreRequest.cs | 59 + .../Models/Api20211201/RestoreRequest.json.cs | 171 + .../Api20211201/RestoreRequestResource.cs | 122 + .../RestoreRequestResource.json.cs | 110 + .../Models/Api20211201/RetentionDuration.cs | 78 + .../Api20211201/RetentionDuration.json.cs | 108 + .../api/Models/Api20211201/RetentionPolicy.cs | 57 + .../Api20211201/RetentionPolicy.json.cs | 125 + .../api/Models/Api20211201/SchedulePolicy.cs | 57 + .../Models/Api20211201/SchedulePolicy.json.cs | 133 + .../api/Models/Api20211201/SecurityPinBase.cs | 51 + .../Api20211201/SecurityPinBase.json.cs | 114 + .../api/Models/Api20211201/Settings.cs | 101 + .../api/Models/Api20211201/Settings.json.cs | 110 + .../Api20211201/SimpleRetentionPolicy.cs | 109 + .../Api20211201/SimpleRetentionPolicy.json.cs | 108 + .../Api20211201/SimpleSchedulePolicy.cs | 191 + .../Api20211201/SimpleSchedulePolicy.json.cs | 132 + .../Api20211201/SimpleSchedulePolicyV2.cs | 205 + .../SimpleSchedulePolicyV2.json.cs | 114 + .../Models/Api20211201/SqlDataDirectory.cs | 85 + .../Api20211201/SqlDataDirectory.json.cs | 110 + .../Api20211201/SqlDataDirectoryMapping.cs | 102 + .../SqlDataDirectoryMapping.json.cs | 112 + .../Models/Api20211201/SubProtectionPolicy.cs | 146 + .../Api20211201/SubProtectionPolicy.json.cs | 112 + .../SubProtectionPolicyTieringPolicy.cs | 43 + ...rotectionPolicyTieringPolicy.dictionary.cs | 75 + .../SubProtectionPolicyTieringPolicy.json.cs | 111 + .../Api20211201/TargetAfsRestoreInfo.cs | 68 + .../Api20211201/TargetAfsRestoreInfo.json.cs | 108 + .../Models/Api20211201/TargetRestoreInfo.cs | 102 + .../Api20211201/TargetRestoreInfo.json.cs | 112 + .../api/Models/Api20211201/TieringPolicy.cs | 131 + .../Models/Api20211201/TieringPolicy.json.cs | 114 + .../Models/Api20211201/TokenInformation.cs | 85 + .../Api20211201/TokenInformation.json.cs | 110 + .../Api20211201/TriggerDataMoveRequest.cs | 136 + .../TriggerDataMoveRequest.json.cs | 124 + .../Models/Api20211201/UnlockDeleteRequest.cs | 64 + .../Api20211201/UnlockDeleteRequest.json.cs | 116 + .../Api20211201/UnlockDeleteResponse.cs | 51 + .../Api20211201/UnlockDeleteResponse.json.cs | 106 + .../ValidateIaasVMRestoreOperationRequest.cs | 69 + ...idateIaasVMRestoreOperationRequest.json.cs | 107 + .../Api20211201/ValidateOperationRequest.cs | 57 + .../ValidateOperationRequest.json.cs | 125 + .../Api20211201/ValidateOperationResponse.cs | 51 + .../ValidateOperationResponse.json.cs | 114 + .../Api20211201/ValidateOperationsResponse.cs | 57 + .../ValidateOperationsResponse.json.cs | 105 + .../ValidateRestoreOperationRequest.cs | 91 + .../ValidateRestoreOperationRequest.json.cs | 124 + .../api/Models/Api20211201/VaultJob.cs | 164 + .../api/Models/Api20211201/VaultJob.json.cs | 130 + .../Models/Api20211201/VaultJobErrorInfo.cs | 85 + .../Api20211201/VaultJobErrorInfo.json.cs | 118 + .../Api20211201/VaultJobExtendedInfo.cs | 51 + .../Api20211201/VaultJobExtendedInfo.json.cs | 106 + .../VaultJobExtendedInfoPropertyBag.cs | 35 + ...ltJobExtendedInfoPropertyBag.dictionary.cs | 75 + .../VaultJobExtendedInfoPropertyBag.json.cs | 107 + ...ultStorageConfigOperationResultResponse.cs | 59 + ...orageConfigOperationResultResponse.json.cs | 124 + .../Api20211201/WeeklyRetentionFormat.cs | 68 + .../Api20211201/WeeklyRetentionFormat.json.cs | 124 + .../Api20211201/WeeklyRetentionSchedule.cs | 118 + .../WeeklyRetentionSchedule.json.cs | 126 + .../api/Models/Api20211201/WeeklySchedule.cs | 62 + .../Models/Api20211201/WeeklySchedule.json.cs | 123 + .../Api20211201/WorkloadInquiryDetails.cs | 167 + .../WorkloadInquiryDetails.json.cs | 110 + .../api/Models/Api20211201/WorkloadItem.cs | 121 + .../Models/Api20211201/WorkloadItem.json.cs | 155 + .../Api20211201/WorkloadItemResource.cs | 172 + .../Api20211201/WorkloadItemResource.json.cs | 110 + .../Api20211201/WorkloadItemResourceList.cs | 76 + .../WorkloadItemResourceList.json.cs | 116 + .../Api20211201/WorkloadProtectableItem.cs | 121 + .../WorkloadProtectableItem.json.cs | 171 + .../WorkloadProtectableItemResource.cs | 172 + .../WorkloadProtectableItemResource.json.cs | 110 + .../WorkloadProtectableItemResourceList.cs | 76 + ...orkloadProtectableItemResourceList.json.cs | 117 + .../Api20211201/YearlyRetentionSchedule.cs | 201 + .../YearlyRetentionSchedule.json.cs | 132 + .../Models/RecoveryServicesBackupIdentity.cs | 299 + .../RecoveryServicesBackupIdentity.json.cs | 135 + .../api/RecoveryServicesBackupClient.cs | 15076 ++++++++++++++++ .../api/Support/AcquireStorageAccountLock.cs | 98 + .../api/Support/AzureFileShareType.cs | 100 + .../generated/api/Support/BackupEngineType.cs | 100 + .../generated/api/Support/BackupItemType.cs | 124 + .../api/Support/BackupManagementType.cs | 112 + .../generated/api/Support/BackupType.cs | 106 + .../generated/api/Support/ContainerType.cs | 130 + .../generated/api/Support/CopyOptions.cs | 104 + .../generated/api/Support/CreateMode.cs | 102 + .../generated/api/Support/DataMoveLevel.cs | 100 + .../generated/api/Support/DataSourceType.cs | 124 + .../generated/api/Support/DayOfWeek.cs | 107 + .../generated/api/Support/DedupState.cs | 100 + .../api/Support/EncryptionAtRestType.cs | 100 + .../api/Support/EnhancedSecurityState.cs | 100 + .../generated/api/Support/FabricName.cs | 98 + .../generated/api/Support/HealthState.cs | 102 + .../generated/api/Support/HealthStatus.cs | 102 + .../generated/api/Support/HttpStatusCode.cs | 188 + .../generated/api/Support/IaasvmPolicyType.cs | 99 + .../Support/InfrastructureEncryptionState.cs | 105 + .../generated/api/Support/InquiryStatus.cs | 100 + .../generated/api/Support/IntentItemType.cs | 100 + .../generated/api/Support/JobOperationType.cs | 116 + .../generated/api/Support/JobStatus.cs | 108 + .../api/Support/JobSupportedAction.cs | 99 + .../generated/api/Support/LastBackupStatus.cs | 102 + .../generated/api/Support/LastUpdateStatus.cs | 109 + .../generated/api/Support/MabServerType.cs | 124 + .../generated/api/Support/MonthOfYear.cs | 119 + .../api/Support/OperationStatusValues.cs | 104 + .../generated/api/Support/OperationType.cs | 100 + .../generated/api/Support/OverwriteOptions.cs | 100 + .../generated/api/Support/PolicyType.cs | 106 + .../PrivateEndpointConnectionStatus.cs | 108 + .../api/Support/ProtectedItemHealthStatus.cs | 104 + .../api/Support/ProtectedItemState.cs | 106 + .../api/Support/ProtectionIntentItemType.cs | 106 + .../generated/api/Support/ProtectionState.cs | 106 + .../generated/api/Support/ProtectionStatus.cs | 104 + .../api/Support/ProvisioningState.cs | 102 + .../generated/api/Support/RecoveryMode.cs | 100 + .../api/Support/RecoveryPointTierStatus.cs | 104 + .../api/Support/RecoveryPointTierType.cs | 102 + .../generated/api/Support/RecoveryType.cs | 104 + .../api/Support/RehydrationPriority.cs | 98 + .../api/Support/ResourceHealthStatus.cs | 106 + .../api/Support/RestorePointQueryType.cs | 108 + .../generated/api/Support/RestorePointType.cs | 104 + .../api/Support/RestoreRequestType.cs | 100 + .../api/Support/RetentionDurationType.cs | 104 + .../api/Support/RetentionScheduleFormat.cs | 100 + .../generated/api/Support/ScheduleRunType.cs | 102 + .../api/Support/SoftDeleteFeatureState.cs | 100 + .../api/Support/SqlDataDirectoryType.cs | 100 + .../generated/api/Support/StorageType.cs | 104 + .../generated/api/Support/StorageTypeState.cs | 102 + .../generated/api/Support/SupportStatus.cs | 104 + .../generated/api/Support/TieringMode.cs | 107 + .../generated/api/Support/Type.cs | 100 + .../generated/api/Support/UsagesUnit.cs | 106 + .../generated/api/Support/ValidationStatus.cs | 100 + .../generated/api/Support/WeekOfMonth.cs | 105 + .../generated/api/Support/WorkloadItemType.cs | 108 + .../generated/api/Support/WorkloadType.cs | 124 + .../generated/api/Support/XcoolState.cs | 100 + .../generated/runtime/CmdInfoHandler.cs | 40 + .../Conversions/ConversionException.cs | 17 + .../runtime/Conversions/IJsonConverter.cs | 13 + .../Conversions/Instances/BinaryConverter.cs | 24 + .../Conversions/Instances/BooleanConverter.cs | 13 + .../Instances/DateTimeConverter.cs | 18 + .../Instances/DateTimeOffsetConverter.cs | 15 + .../Conversions/Instances/DecimalConverter.cs | 16 + .../Conversions/Instances/DoubleConverter.cs | 13 + .../Conversions/Instances/EnumConverter.cs | 30 + .../Conversions/Instances/GuidConverter.cs | 15 + .../Instances/HashSet'1Converter.cs | 27 + .../Conversions/Instances/Int16Converter.cs | 13 + .../Conversions/Instances/Int32Converter.cs | 13 + .../Conversions/Instances/Int64Converter.cs | 13 + .../Instances/JsonArrayConverter.cs | 13 + .../Instances/JsonObjectConverter.cs | 13 + .../Conversions/Instances/SingleConverter.cs | 13 + .../Conversions/Instances/StringConverter.cs | 13 + .../Instances/TimeSpanConverter.cs | 15 + .../Conversions/Instances/UInt16Converter.cs | 13 + .../Conversions/Instances/UInt32Converter.cs | 13 + .../Conversions/Instances/UInt64Converter.cs | 13 + .../Conversions/Instances/UriConverter.cs | 15 + .../runtime/Conversions/JsonConverter.cs | 21 + .../Conversions/JsonConverterAttribute.cs | 18 + .../Conversions/JsonConverterFactory.cs | 91 + .../Conversions/StringLikeConverter.cs | 45 + .../Customizations/IJsonSerializable.cs | 263 + .../runtime/Customizations/JsonArray.cs | 13 + .../runtime/Customizations/JsonBoolean.cs | 16 + .../runtime/Customizations/JsonNode.cs | 21 + .../runtime/Customizations/JsonNumber.cs | 78 + .../runtime/Customizations/JsonObject.cs | 183 + .../runtime/Customizations/JsonString.cs | 34 + .../runtime/Customizations/XNodeArray.cs | 44 + .../generated/runtime/EventData.cs | 78 + .../generated/runtime/EventListener.cs | 247 + .../generated/runtime/Events.cs | 27 + .../generated/runtime/Extensions.cs | 117 + .../Extensions/StringBuilderExtensions.cs | 23 + .../Helpers/Extensions/TypeExtensions.cs | 61 + .../generated/runtime/Helpers/Seperator.cs | 11 + .../generated/runtime/Helpers/TypeDetails.cs | 116 + .../generated/runtime/Helpers/XHelper.cs | 75 + .../generated/runtime/IAssociativeArray.cs | 24 + .../generated/runtime/IHeaderSerializable.cs | 14 + .../generated/runtime/ISendAsync.cs | 296 + .../generated/runtime/InfoAttribute.cs | 34 + .../generated/runtime/Iso/IsoDate.cs | 214 + .../generated/runtime/JsonType.cs | 18 + .../generated/runtime/Method.cs | 19 + .../generated/runtime/Models/JsonMember.cs | 83 + .../generated/runtime/Models/JsonModel.cs | 89 + .../runtime/Models/JsonModelCache.cs | 19 + .../runtime/Nodes/Collections/JsonArray.cs | 65 + .../Nodes/Collections/XImmutableArray.cs | 62 + .../runtime/Nodes/Collections/XList.cs | 64 + .../runtime/Nodes/Collections/XNodeArray.cs | 68 + .../runtime/Nodes/Collections/XSet.cs | 60 + .../generated/runtime/Nodes/JsonBoolean.cs | 42 + .../generated/runtime/Nodes/JsonDate.cs | 173 + .../generated/runtime/Nodes/JsonNode.cs | 250 + .../generated/runtime/Nodes/JsonNumber.cs | 109 + .../generated/runtime/Nodes/JsonObject.cs | 172 + .../generated/runtime/Nodes/JsonString.cs | 42 + .../generated/runtime/Nodes/XBinary.cs | 40 + .../generated/runtime/Nodes/XNull.cs | 15 + .../Parser/Exceptions/ParseException.cs | 24 + .../generated/runtime/Parser/JsonParser.cs | 180 + .../generated/runtime/Parser/JsonToken.cs | 66 + .../generated/runtime/Parser/JsonTokenizer.cs | 177 + .../generated/runtime/Parser/Location.cs | 43 + .../runtime/Parser/Readers/SourceReader.cs | 130 + .../generated/runtime/Parser/TokenReader.cs | 39 + .../generated/runtime/PipelineMocking.cs | 262 + .../generated/runtime/Response.cs | 27 + .../runtime/Serialization/JsonSerializer.cs | 350 + .../Serialization/PropertyTransformation.cs | 21 + .../Serialization/SerializationOptions.cs | 65 + .../generated/runtime/SerializationMode.cs | 16 + .../runtime/UndeclaredResponseException.cs | 112 + .../generated/runtime/Writers/JsonWriter.cs | 223 + .../generated/runtime/delegates.cs | 23 + swaggerci/recoveryservicesbackup/readme.md | 10 + 811 files changed, 106019 insertions(+) create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Any.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Any.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api10/ErrorAdditionalInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupGoalFeatureSupportRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupGoalFeatureSupportRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerEngine.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerEngine.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareBackupRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareBackupRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProvisionIlrRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProvisionIlrRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRecoveryPoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRecoveryPoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRestoreRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRestoreRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmcontainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmcontainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmcontainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmcontainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmErrorInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmErrorInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmHealthDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmHealthDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJob.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJob.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobTaskDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobTaskDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobV2.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobV2.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureRecoveryServiceVaultProtectionIntent.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureRecoveryServiceVaultProtectionIntent.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureResourceProtectionIntent.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureResourceProtectionIntent.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItemExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItemExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlagWorkloadContainerProtectionContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlagWorkloadContainerProtectionContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageErrorInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageErrorInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJob.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJob.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobTaskDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobTaskDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageProtectableContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageProtectableContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectableContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectableContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectionContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectionContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseWorkloadItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseWorkloadItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemProtectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemProtectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemWorkloadItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemWorkloadItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseWorkloadItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseWorkloadItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemProtectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemProtectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemWorkloadItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemWorkloadItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlAvailabilityGroupProtectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlAvailabilityGroupProtectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseWorkloadItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseWorkloadItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceProtectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceProtectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceWorkloadItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceWorkloadItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadAutoProtectionIntent.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadAutoProtectionIntent.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadBackupRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadBackupRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerAutoProtectionIntent.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerAutoProtectionIntent.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadErrorInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadErrorInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJob.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJob.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobTaskDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobTaskDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRecoveryPoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRecoveryPoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRestoreRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRestoreRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRecoveryPoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRecoveryPoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRecoveryPoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRecoveryPoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreWithRehydrateRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreWithRehydrateRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlAutoProtectionIntent.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlAutoProtectionIntent.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRecoveryPoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRecoveryPoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPointExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPointExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreWithRehydrateRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreWithRehydrateRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBase.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBase.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsage.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsage.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsageList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsageList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequestResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequestResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfig.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfig.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfigResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfigResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfig.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfig.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtended.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtended.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtendedResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtendedResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfig.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfig.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfigResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfigResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BekDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BekDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEngineQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEngineQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEnginesQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEnginesQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupSummariesQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupSummariesQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainerQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainerQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainersInquiryQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainersInquiryQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsRefreshContainersQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsRefreshContainersQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsWorkloadItemQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsWorkloadItemQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmspoQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmspoQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsrpQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsrpQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryDisplay.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryDisplay.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForLogSpecification.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForLogSpecification.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForProperties.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForProperties.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForServiceSpecification.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForServiceSpecification.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryValueForSingleApi.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryValueForSingleApi.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientScriptForConnect.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientScriptForConnect.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudError.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudError.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudErrorBody.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudErrorBody.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ContainerIdentityInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ContainerIdentityInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionFormat.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionFormat.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionSchedule.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionSchedule.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailySchedule.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailySchedule.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Day.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Day.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskExclusionProperties.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskExclusionProperties.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskInformation.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskInformation.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DistributedNodesInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DistributedNodesInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmBackupEngine.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmBackupEngine.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainerExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainerExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmErrorInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmErrorInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJob.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJob.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobTaskDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobTaskDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/EncryptionDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/EncryptionDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ErrorDetail.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ErrorDetail.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExportJobsOperationResultInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExportJobsOperationResultInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExtendedProperties.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExtendedProperties.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/FeatureSupportRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/FeatureSupportRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericRecoveryPoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericRecoveryPoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GetProtectedItemQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GetProtectedItemQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/HourlySchedule.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/HourlySchedule.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmProtectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmProtectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMBackupRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMBackupRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreWithRehydrationRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreWithRehydrationRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVmilrRegistrationRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVmilrRegistrationRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityBasedRestoreDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityBasedRestoreDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequestResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequestResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryValidation.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryValidation.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantItemRecoveryTarget.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantItemRecoveryTarget.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantRpAdditionalDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantRpAdditionalDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Job.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Job.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KekDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KekDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KeyAndSecretDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KeyAndSecretDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KpiResourceHealthDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KpiResourceHealthDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ListRecoveryPointsRecommendedForMoveRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ListRecoveryPointsRecommendedForMoveRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LogSchedulePolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LogSchedulePolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermRetentionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermRetentionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermSchedulePolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermSchedulePolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerHealthDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerHealthDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabErrorInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabErrorInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItemExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItemExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJob.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJob.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobTaskDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobTaskDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabProtectionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabProtectionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MonthlyRetentionSchedule.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MonthlyRetentionSchedule.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MoveRpAcrossTiersRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MoveRpAcrossTiersRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NameInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NameInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponseError.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponseError.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBase.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBase.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBaseResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBaseResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatus.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusError.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusError.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusProvisionIlrExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusProvisionIlrExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusValidateOperationExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusValidateOperationExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PointInTimeRange.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PointInTimeRange.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreBackupValidation.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreBackupValidation.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnection.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnection.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnectionResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnectionResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateLinkServiceConnectionState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateLinkServiceConnectionState.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainer.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntent.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntent.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyQueryObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyQueryObject.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPoint.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPoint.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointDiskConfiguration.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointDiskConfiguration.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointMoveReadinessInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointMoveReadinessInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointRehydrationInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointRehydrationInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformation.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformation.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationV2.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationV2.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Resource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Resource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardOperationDetail.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardOperationDetail.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBase.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBase.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceHealthDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceHealthDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreFileSpecs.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreFileSpecs.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequestResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequestResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionDuration.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionDuration.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SchedulePolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SchedulePolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SecurityPinBase.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SecurityPinBase.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Settings.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Settings.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleRetentionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleRetentionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicyV2.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicyV2.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectory.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectory.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectoryMapping.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectoryMapping.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetAfsRestoreInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetAfsRestoreInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetRestoreInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetRestoreInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TieringPolicy.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TieringPolicy.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TokenInformation.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TokenInformation.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TriggerDataMoveRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TriggerDataMoveRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateIaasVMRestoreOperationRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateIaasVMRestoreOperationRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationsResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationsResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateRestoreOperationRequest.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateRestoreOperationRequest.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJob.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJob.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobErrorInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobErrorInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfo.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfo.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.dictionary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultStorageConfigOperationResultResponse.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultStorageConfigOperationResultResponse.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionFormat.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionFormat.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionSchedule.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionSchedule.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklySchedule.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklySchedule.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadInquiryDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadInquiryDetails.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItem.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItem.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResource.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResource.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResourceList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResourceList.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/YearlyRetentionSchedule.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/YearlyRetentionSchedule.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/RecoveryServicesBackupIdentity.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Models/RecoveryServicesBackupIdentity.json.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/RecoveryServicesBackupClient.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/AcquireStorageAccountLock.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/AzureFileShareType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/BackupEngineType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/BackupItemType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/BackupManagementType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/BackupType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/ContainerType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/CopyOptions.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/CreateMode.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/DataMoveLevel.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/DataSourceType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/DayOfWeek.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/DedupState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/EncryptionAtRestType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/EnhancedSecurityState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/FabricName.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/HealthState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/HealthStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/HttpStatusCode.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/IaasvmPolicyType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/InfrastructureEncryptionState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/InquiryStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/IntentItemType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/JobOperationType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/JobStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/JobSupportedAction.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/LastBackupStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/LastUpdateStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/MabServerType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/MonthOfYear.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/OperationStatusValues.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/OperationType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/OverwriteOptions.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/PolicyType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/PrivateEndpointConnectionStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/ProtectedItemHealthStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/ProtectedItemState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionIntentItemType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/ProvisioningState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryMode.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryPointTierStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryPointTierType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/RehydrationPriority.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/ResourceHealthStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/RestorePointQueryType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/RestorePointType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/RestoreRequestType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/RetentionDurationType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/RetentionScheduleFormat.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/ScheduleRunType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/SoftDeleteFeatureState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/SqlDataDirectoryType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/StorageType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/StorageTypeState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/SupportStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/TieringMode.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/Type.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/UsagesUnit.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/ValidationStatus.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/WeekOfMonth.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/WorkloadItemType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/WorkloadType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/api/Support/XcoolState.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/CmdInfoHandler.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/ConversionException.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/IJsonConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/BinaryConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/BooleanConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DateTimeConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DecimalConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DoubleConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/EnumConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/GuidConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/HashSet'1Converter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int16Converter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int32Converter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int64Converter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/JsonArrayConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/JsonObjectConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/SingleConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/StringConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/TimeSpanConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt16Converter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt32Converter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt64Converter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UriConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverterAttribute.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverterFactory.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Conversions/StringLikeConverter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Customizations/IJsonSerializable.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonArray.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonBoolean.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonNode.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonNumber.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonString.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Customizations/XNodeArray.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/EventData.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/EventListener.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Events.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Extensions.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Extensions/TypeExtensions.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Seperator.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Helpers/TypeDetails.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Helpers/XHelper.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/IAssociativeArray.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/IHeaderSerializable.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/ISendAsync.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/InfoAttribute.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Iso/IsoDate.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/JsonType.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Method.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonMember.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonModel.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonModelCache.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/JsonArray.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XImmutableArray.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XList.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XNodeArray.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XSet.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonBoolean.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonDate.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonNode.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonNumber.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonObject.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonString.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/XBinary.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Nodes/XNull.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Parser/Exceptions/ParseException.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonParser.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonToken.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonTokenizer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Parser/Location.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Parser/Readers/SourceReader.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Parser/TokenReader.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/PipelineMocking.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Response.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Serialization/JsonSerializer.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Serialization/PropertyTransformation.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Serialization/SerializationOptions.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/SerializationMode.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/UndeclaredResponseException.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/Writers/JsonWriter.cs create mode 100644 swaggerci/recoveryservicesbackup/generated/runtime/delegates.cs create mode 100644 swaggerci/recoveryservicesbackup/readme.md diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Any.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Any.cs new file mode 100644 index 000000000000..201d8b7f51f3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Any.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Any object + public partial class Any : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAnyInternal + { + + /// Creates an new instance. + public Any() + { + + } + } + /// Any object + public partial interface IAny : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + + } + /// Any object + internal partial interface IAnyInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Any.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Any.json.cs new file mode 100644 index 000000000000..711416c37a2a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Any.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Any object + public partial class Any + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal Any(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new Any(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api10/ErrorAdditionalInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api10/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..c3319b37105b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api10/ErrorAdditionalInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource management error additional info. + public partial class ErrorAdditionalInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny _info; + + /// The additional info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Any()); } + + /// Internal Acessors for Info + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Any()); set { {_info = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _type; + + /// The additional info type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ErrorAdditionalInfo() + { + + } + } + /// The resource management error additional info. + public partial interface IErrorAdditionalInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The additional info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The additional info.", + SerializedName = @"info", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny Info { get; } + /// The additional info type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The additional info type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The resource management error additional info. + internal partial interface IErrorAdditionalInfoInternal + + { + /// The additional info. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny Info { get; set; } + /// The additional info type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs new file mode 100644 index 000000000000..ede86dd1b28a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api10/ErrorAdditionalInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource management error additional info. + public partial class ErrorAdditionalInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Any.FromJson(__jsonInfo) : Info;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupGoalFeatureSupportRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupGoalFeatureSupportRequest.cs new file mode 100644 index 000000000000..a11df72788bb --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupGoalFeatureSupportRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure backup goal feature specific request. + public partial class AzureBackupGoalFeatureSupportRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupGoalFeatureSupportRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupGoalFeatureSupportRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest __featureSupportRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.FeatureSupportRequest(); + + /// backup support feature type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FeatureType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequestInternal)__featureSupportRequest).FeatureType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequestInternal)__featureSupportRequest).FeatureType = value ; } + + /// Creates an new instance. + public AzureBackupGoalFeatureSupportRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__featureSupportRequest), __featureSupportRequest); + await eventListener.AssertObjectIsValid(nameof(__featureSupportRequest), __featureSupportRequest); + } + } + /// Azure backup goal feature specific request. + public partial interface IAzureBackupGoalFeatureSupportRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest + { + + } + /// Azure backup goal feature specific request. + internal partial interface IAzureBackupGoalFeatureSupportRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequestInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupGoalFeatureSupportRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupGoalFeatureSupportRequest.json.cs new file mode 100644 index 000000000000..9eb74d7e4591 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupGoalFeatureSupportRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure backup goal feature specific request. + public partial class AzureBackupGoalFeatureSupportRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureBackupGoalFeatureSupportRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __featureSupportRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.FeatureSupportRequest(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupGoalFeatureSupportRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupGoalFeatureSupportRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupGoalFeatureSupportRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureBackupGoalFeatureSupportRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __featureSupportRequest?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerContainer.cs new file mode 100644 index 000000000000..9543d947fd06 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerContainer.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureBackupServer (DPMVenus) workload-specific protection container. + public partial class AzureBackupServerContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupServerContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupServerContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainer __dpmContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Specifies whether the container is re-registrable. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? CanReRegister { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).CanReRegister; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).CanReRegister = value ?? default(bool); } + + /// ID of container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).ContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).ContainerId = value ?? null; } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).ContainerType = value ; } + + /// Backup engine Agent version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DpmAgentVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).DpmAgentVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).DpmAgentVersion = value ?? null; } + + /// List of BackupEngines protecting the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] DpmServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).DpmServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).DpmServer = value ?? null /* arrayOf */; } + + /// Extended Info of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).ExtendedInfo = value ?? null /* model class */; } + + /// Last refresh time of the DPMContainer. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoLastRefreshedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).ExtendedInfoLastRefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).ExtendedInfoLastRefreshedAt = value ?? default(global::System.DateTime); } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).HealthStatus = value ?? null; } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).ProtectableObjectType = value ?? null; } + + /// Number of protected items in the BackupEngine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public long? ProtectedItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).ProtectedItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).ProtectedItemCount = value ?? default(long); } + + /// Protection status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).ProtectionStatus = value ?? null; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__dpmContainer).RegistrationStatus = value ?? null; } + + /// To check if upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? UpgradeAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).UpgradeAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal)__dpmContainer).UpgradeAvailable = value ?? default(bool); } + + /// Creates an new instance. + public AzureBackupServerContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__dpmContainer), __dpmContainer); + await eventListener.AssertObjectIsValid(nameof(__dpmContainer), __dpmContainer); + } + } + /// AzureBackupServer (DPMVenus) workload-specific protection container. + public partial interface IAzureBackupServerContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainer + { + + } + /// AzureBackupServer (DPMVenus) workload-specific protection container. + internal partial interface IAzureBackupServerContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerContainer.json.cs new file mode 100644 index 000000000000..09a1e892127f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureBackupServer (DPMVenus) workload-specific protection container. + public partial class AzureBackupServerContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureBackupServerContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __dpmContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmContainer(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupServerContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupServerContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupServerContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureBackupServerContainer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __dpmContainer?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerEngine.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerEngine.cs new file mode 100644 index 000000000000..7925f7eb7831 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerEngine.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup engine type when Azure Backup Server is used to manage the backups. + public partial class AzureBackupServerEngine : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupServerEngine, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupServerEngineInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase __backupEngineBase = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineBase(); + + /// Backup agent version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string AzureBackupAgentVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).AzureBackupAgentVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).AzureBackupAgentVersion = value ?? null; } + + /// ID of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupEngineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineId = value ?? null; } + + /// + /// Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupEngineState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineState = value ?? null; } + + /// Type of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType BackupEngineType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineType = value ; } + + /// Type of backup management for the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Flag indicating if the backup engine be registered, once already registered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? CanReRegister { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).CanReRegister; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).CanReRegister = value ?? default(bool); } + + /// Backup engine version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DpmVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).DpmVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).DpmVersion = value ?? null; } + + /// Extended info of the backupengine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfo = value ?? null /* model class */; } + + /// Disk space currently available in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public double? ExtendedInfoAvailableDiskSpace { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoAvailableDiskSpace; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoAvailableDiskSpace = value ?? default(double); } + + /// Protected instances in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoAzureProtectedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoAzureProtectedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoAzureProtectedInstance = value ?? default(int); } + + /// Database name of backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoDatabaseName = value ?? null; } + + /// Number of disks in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoDiskCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoDiskCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoDiskCount = value ?? default(int); } + + /// Number of protected items in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoProtectedItemsCount = value ?? default(int); } + + /// Number of protected servers in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoProtectedServersCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoProtectedServersCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoProtectedServersCount = value ?? default(int); } + + /// Last refresh time in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoRefreshedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoRefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoRefreshedAt = value ?? default(global::System.DateTime); } + + /// Disk space used in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public double? ExtendedInfoUsedDiskSpace { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoUsedDiskSpace; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoUsedDiskSpace = value ?? default(double); } + + /// Friendly name of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).FriendlyName = value ?? null; } + + /// Backup status of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).HealthStatus = value ?? null; } + + /// To check if backup agent upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAzureBackupAgentUpgradeAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).IsAzureBackupAgentUpgradeAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).IsAzureBackupAgentUpgradeAvailable = value ?? default(bool); } + + /// To check if backup engine upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDpmUpgradeAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).IsDpmUpgradeAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).IsDpmUpgradeAvailable = value ?? default(bool); } + + /// Registration status of the backup engine with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).RegistrationStatus = value ?? null; } + + /// Creates an new instance. + public AzureBackupServerEngine() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__backupEngineBase), __backupEngineBase); + await eventListener.AssertObjectIsValid(nameof(__backupEngineBase), __backupEngineBase); + } + } + /// Backup engine type when Azure Backup Server is used to manage the backups. + public partial interface IAzureBackupServerEngine : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase + { + + } + /// Backup engine type when Azure Backup Server is used to manage the backups. + internal partial interface IAzureBackupServerEngineInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerEngine.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerEngine.json.cs new file mode 100644 index 000000000000..282f0f327712 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureBackupServerEngine.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup engine type when Azure Backup Server is used to manage the backups. + public partial class AzureBackupServerEngine + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureBackupServerEngine(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __backupEngineBase = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineBase(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupServerEngine. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupServerEngine. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureBackupServerEngine FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureBackupServerEngine(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __backupEngineBase?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareBackupRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareBackupRequest.cs new file mode 100644 index 000000000000..f454555ac4a8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareBackupRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureFileShare workload-specific backup request. + public partial class AzureFileShareBackupRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareBackupRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareBackupRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest __backupRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupRequest(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal)__backupRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal)__backupRequest).ObjectType = value ; } + + /// Backing field for property. + private global::System.DateTime? _recoveryPointExpiryTimeInUtc; + + /// Backup copy will expire after the time specified (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? RecoveryPointExpiryTimeInUtc { get => this._recoveryPointExpiryTimeInUtc; set => this._recoveryPointExpiryTimeInUtc = value; } + + /// Creates an new instance. + public AzureFileShareBackupRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__backupRequest), __backupRequest); + await eventListener.AssertObjectIsValid(nameof(__backupRequest), __backupRequest); + } + } + /// AzureFileShare workload-specific backup request. + public partial interface IAzureFileShareBackupRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest + { + /// Backup copy will expire after the time specified (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup copy will expire after the time specified (UTC).", + SerializedName = @"recoveryPointExpiryTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecoveryPointExpiryTimeInUtc { get; set; } + + } + /// AzureFileShare workload-specific backup request. + internal partial interface IAzureFileShareBackupRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal + { + /// Backup copy will expire after the time specified (UTC). + global::System.DateTime? RecoveryPointExpiryTimeInUtc { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareBackupRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareBackupRequest.json.cs new file mode 100644 index 000000000000..2c82aaf9b95d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareBackupRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureFileShare workload-specific backup request. + public partial class AzureFileShareBackupRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFileShareBackupRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __backupRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupRequest(json); + {_recoveryPointExpiryTimeInUtc = If( json?.PropertyT("recoveryPointExpiryTimeInUTC"), out var __jsonRecoveryPointExpiryTimeInUtc) ? global::System.DateTime.TryParse((string)__jsonRecoveryPointExpiryTimeInUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRecoveryPointExpiryTimeInUtcValue) ? __jsonRecoveryPointExpiryTimeInUtcValue : RecoveryPointExpiryTimeInUtc : RecoveryPointExpiryTimeInUtc;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareBackupRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareBackupRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareBackupRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureFileShareBackupRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __backupRequest?.ToJson(container, serializationMode); + AddIf( null != this._recoveryPointExpiryTimeInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointExpiryTimeInUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "recoveryPointExpiryTimeInUTC" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectableItem.cs new file mode 100644 index 000000000000..6af8bb947c10 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectableItem.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Protectable item for Azure Fileshare workloads. + public partial class AzureFileShareProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem __workloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItem(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType? _azureFileShareType; + + /// File Share type XSync or XSMB. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType? AzureFileShareType { get => this._azureFileShareType; set => this._azureFileShareType = value; } + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).FriendlyName = value ?? null; } + + /// Backing field for property. + private string _parentContainerFabricId; + + /// + /// Full Fabric ID of container to which this protectable item belongs. For example, ARM ID. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ParentContainerFabricId { get => this._parentContainerFabricId; set => this._parentContainerFabricId = value; } + + /// Backing field for property. + private string _parentContainerFriendlyName; + + /// Friendly name of container to which this protectable item belongs. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ParentContainerFriendlyName { get => this._parentContainerFriendlyName; set => this._parentContainerFriendlyName = value; } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).WorkloadType = value ?? null; } + + /// Creates an new instance. + public AzureFileShareProtectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__workloadProtectableItem), __workloadProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__workloadProtectableItem), __workloadProtectableItem); + } + } + /// Protectable item for Azure Fileshare workloads. + public partial interface IAzureFileShareProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem + { + /// File Share type XSync or XSMB. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File Share type XSync or XSMB.", + SerializedName = @"azureFileShareType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType? AzureFileShareType { get; set; } + /// + /// Full Fabric ID of container to which this protectable item belongs. For example, ARM ID. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Full Fabric ID of container to which this protectable item belongs. For example, ARM ID.", + SerializedName = @"parentContainerFabricId", + PossibleTypes = new [] { typeof(string) })] + string ParentContainerFabricId { get; set; } + /// Friendly name of container to which this protectable item belongs. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of container to which this protectable item belongs.", + SerializedName = @"parentContainerFriendlyName", + PossibleTypes = new [] { typeof(string) })] + string ParentContainerFriendlyName { get; set; } + + } + /// Protectable item for Azure Fileshare workloads. + internal partial interface IAzureFileShareProtectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal + { + /// File Share type XSync or XSMB. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType? AzureFileShareType { get; set; } + /// + /// Full Fabric ID of container to which this protectable item belongs. For example, ARM ID. + /// + string ParentContainerFabricId { get; set; } + /// Friendly name of container to which this protectable item belongs. + string ParentContainerFriendlyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectableItem.json.cs new file mode 100644 index 000000000000..e8bb543afff6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Protectable item for Azure Fileshare workloads. + public partial class AzureFileShareProtectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFileShareProtectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __workloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItem(json); + {_parentContainerFabricId = If( json?.PropertyT("parentContainerFabricId"), out var __jsonParentContainerFabricId) ? (string)__jsonParentContainerFabricId : (string)ParentContainerFabricId;} + {_parentContainerFriendlyName = If( json?.PropertyT("parentContainerFriendlyName"), out var __jsonParentContainerFriendlyName) ? (string)__jsonParentContainerFriendlyName : (string)ParentContainerFriendlyName;} + {_azureFileShareType = If( json?.PropertyT("azureFileShareType"), out var __jsonAzureFileShareType) ? (string)__jsonAzureFileShareType : (string)AzureFileShareType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectableItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureFileShareProtectableItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __workloadProtectableItem?.ToJson(container, serializationMode); + AddIf( null != (((object)this._parentContainerFabricId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._parentContainerFabricId.ToString()) : null, "parentContainerFabricId" ,container.Add ); + AddIf( null != (((object)this._parentContainerFriendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._parentContainerFriendlyName.ToString()) : null, "parentContainerFriendlyName" ,container.Add ); + AddIf( null != (((object)this._azureFileShareType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._azureFileShareType.ToString()) : null, "azureFileShareType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectionPolicy.cs new file mode 100644 index 000000000000..36395591fc90 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectionPolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureStorage backup policy. + public partial class AzureFileShareProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectionPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType = value ; } + + /// Internal Acessors for RetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectionPolicyInternal.RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy()); set { {_retentionPolicy = value;} } } + + /// Internal Acessors for SchedulePolicy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectionPolicyInternal.SchedulePolicy { get => (this._schedulePolicy = this._schedulePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy()); set { {_schedulePolicy = value;} } } + + /// Number of items associated with this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount = value ?? default(int); } + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy _retentionPolicy; + + /// Retention policy with the details on backup copy retention ranges. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy()); set => this._retentionPolicy = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RetentionPolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)RetentionPolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)RetentionPolicy).Type = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy _schedulePolicy; + + /// Backup schedule specified as part of backup policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy SchedulePolicy { get => (this._schedulePolicy = this._schedulePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy()); set => this._schedulePolicy = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string SchedulePolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)SchedulePolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)SchedulePolicy).Type = value ?? null; } + + /// Backing field for property. + private string _timeZone; + + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TimeZone { get => this._timeZone; set => this._timeZone = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? _workLoadType; + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkLoadType { get => this._workLoadType; set => this._workLoadType = value; } + + /// Creates an new instance. + public AzureFileShareProtectionPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionPolicy), __protectionPolicy); + await eventListener.AssertObjectIsValid(nameof(__protectionPolicy), __protectionPolicy); + } + } + /// AzureStorage backup policy. + public partial interface IAzureFileShareProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"retentionPolicyType", + PossibleTypes = new [] { typeof(string) })] + string RetentionPolicyType { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"schedulePolicyType", + PossibleTypes = new [] { typeof(string) })] + string SchedulePolicyType { get; set; } + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"TimeZone optional input as string. For example: TimeZone = ""Pacific Standard Time"".", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string TimeZone { get; set; } + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of workload for the backup management", + SerializedName = @"workLoadType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkLoadType { get; set; } + + } + /// AzureStorage backup policy. + internal partial interface IAzureFileShareProtectionPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal + { + /// Retention policy with the details on backup copy retention ranges. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy RetentionPolicy { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string RetentionPolicyType { get; set; } + /// Backup schedule specified as part of backup policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy SchedulePolicy { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string SchedulePolicyType { get; set; } + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + string TimeZone { get; set; } + /// Type of workload for the backup management + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkLoadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectionPolicy.json.cs new file mode 100644 index 000000000000..67c94d57f673 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProtectionPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureStorage backup policy. + public partial class AzureFileShareProtectionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFileShareProtectionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(json); + {_schedulePolicy = If( json?.PropertyT("schedulePolicy"), out var __jsonSchedulePolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy.FromJson(__jsonSchedulePolicy) : SchedulePolicy;} + {_retentionPolicy = If( json?.PropertyT("retentionPolicy"), out var __jsonRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy.FromJson(__jsonRetentionPolicy) : RetentionPolicy;} + {_workLoadType = If( json?.PropertyT("workLoadType"), out var __jsonWorkLoadType) ? (string)__jsonWorkLoadType : (string)WorkLoadType;} + {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)TimeZone;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProtectionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureFileShareProtectionPolicy(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionPolicy?.ToJson(container, serializationMode); + AddIf( null != this._schedulePolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._schedulePolicy.ToJson(null,serializationMode) : null, "schedulePolicy" ,container.Add ); + AddIf( null != this._retentionPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionPolicy.ToJson(null,serializationMode) : null, "retentionPolicy" ,container.Add ); + AddIf( null != (((object)this._workLoadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workLoadType.ToString()) : null, "workLoadType" ,container.Add ); + AddIf( null != (((object)this._timeZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._timeZone.ToString()) : null, "timeZone" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProvisionIlrRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProvisionIlrRequest.cs new file mode 100644 index 000000000000..1ddfc896e738 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProvisionIlrRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Update snapshot Uri with the correct friendly Name of the source Azure file share. + /// + public partial class AzureFileShareProvisionIlrRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProvisionIlrRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProvisionIlrRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest __ilrRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IlrRequest(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestInternal)__ilrRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestInternal)__ilrRequest).ObjectType = value ; } + + /// Backing field for property. + private string _recoveryPointId; + + /// Recovery point ID. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryPointId { get => this._recoveryPointId; set => this._recoveryPointId = value; } + + /// Backing field for property. + private string _sourceResourceId; + + /// Source Storage account ARM Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Creates an new instance. + public AzureFileShareProvisionIlrRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__ilrRequest), __ilrRequest); + await eventListener.AssertObjectIsValid(nameof(__ilrRequest), __ilrRequest); + } + } + /// Update snapshot Uri with the correct friendly Name of the source Azure file share. + public partial interface IAzureFileShareProvisionIlrRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest + { + /// Recovery point ID. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point ID.", + SerializedName = @"recoveryPointId", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointId { get; set; } + /// Source Storage account ARM Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source Storage account ARM Id", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + + } + /// Update snapshot Uri with the correct friendly Name of the source Azure file share. + internal partial interface IAzureFileShareProvisionIlrRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestInternal + { + /// Recovery point ID. + string RecoveryPointId { get; set; } + /// Source Storage account ARM Id + string SourceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProvisionIlrRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProvisionIlrRequest.json.cs new file mode 100644 index 000000000000..885801238f02 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareProvisionIlrRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Update snapshot Uri with the correct friendly Name of the source Azure file share. + /// + public partial class AzureFileShareProvisionIlrRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFileShareProvisionIlrRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __ilrRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IlrRequest(json); + {_recoveryPointId = If( json?.PropertyT("recoveryPointId"), out var __jsonRecoveryPointId) ? (string)__jsonRecoveryPointId : (string)RecoveryPointId;} + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProvisionIlrRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProvisionIlrRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareProvisionIlrRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureFileShareProvisionIlrRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __ilrRequest?.ToJson(container, serializationMode); + AddIf( null != (((object)this._recoveryPointId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointId.ToString()) : null, "recoveryPointId" ,container.Add ); + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRecoveryPoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRecoveryPoint.cs new file mode 100644 index 000000000000..87b2e50cd94b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRecoveryPoint.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure File Share workload specific backup copy. + public partial class AzureFileShareRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint(); + + /// Backing field for property. + private string _fileShareSnapshotUri; + + /// Contains Url to the snapshot of fileshare, if applicable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FileShareSnapshotUri { get => this._fileShareSnapshotUri; set => this._fileShareSnapshotUri = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__recoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__recoveryPoint).ObjectType = value ; } + + /// Backing field for property. + private int? _recoveryPointSizeInGb; + + /// Contains recovery point size + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? RecoveryPointSizeInGb { get => this._recoveryPointSizeInGb; set => this._recoveryPointSizeInGb = value; } + + /// Backing field for property. + private global::System.DateTime? _recoveryPointTime; + + /// Time at which this backup copy was created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? RecoveryPointTime { get => this._recoveryPointTime; set => this._recoveryPointTime = value; } + + /// Backing field for property. + private string _recoveryPointType; + + /// + /// Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryPointType { get => this._recoveryPointType; set => this._recoveryPointType = value; } + + /// Creates an new instance. + public AzureFileShareRecoveryPoint() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__recoveryPoint), __recoveryPoint); + await eventListener.AssertObjectIsValid(nameof(__recoveryPoint), __recoveryPoint); + } + } + /// Azure File Share workload specific backup copy. + public partial interface IAzureFileShareRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint + { + /// Contains Url to the snapshot of fileshare, if applicable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Contains Url to the snapshot of fileshare, if applicable", + SerializedName = @"fileShareSnapshotUri", + PossibleTypes = new [] { typeof(string) })] + string FileShareSnapshotUri { get; set; } + /// Contains recovery point size + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Contains recovery point size", + SerializedName = @"recoveryPointSizeInGB", + PossibleTypes = new [] { typeof(int) })] + int? RecoveryPointSizeInGb { get; set; } + /// Time at which this backup copy was created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time at which this backup copy was created.", + SerializedName = @"recoveryPointTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecoveryPointTime { get; set; } + /// + /// Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent.", + SerializedName = @"recoveryPointType", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointType { get; set; } + + } + /// Azure File Share workload specific backup copy. + internal partial interface IAzureFileShareRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal + { + /// Contains Url to the snapshot of fileshare, if applicable + string FileShareSnapshotUri { get; set; } + /// Contains recovery point size + int? RecoveryPointSizeInGb { get; set; } + /// Time at which this backup copy was created. + global::System.DateTime? RecoveryPointTime { get; set; } + /// + /// Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + /// + string RecoveryPointType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRecoveryPoint.json.cs new file mode 100644 index 000000000000..a4e4831638f3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRecoveryPoint.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure File Share workload specific backup copy. + public partial class AzureFileShareRecoveryPoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFileShareRecoveryPoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint(json); + {_recoveryPointType = If( json?.PropertyT("recoveryPointType"), out var __jsonRecoveryPointType) ? (string)__jsonRecoveryPointType : (string)RecoveryPointType;} + {_recoveryPointTime = If( json?.PropertyT("recoveryPointTime"), out var __jsonRecoveryPointTime) ? global::System.DateTime.TryParse((string)__jsonRecoveryPointTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRecoveryPointTimeValue) ? __jsonRecoveryPointTimeValue : RecoveryPointTime : RecoveryPointTime;} + {_fileShareSnapshotUri = If( json?.PropertyT("fileShareSnapshotUri"), out var __jsonFileShareSnapshotUri) ? (string)__jsonFileShareSnapshotUri : (string)FileShareSnapshotUri;} + {_recoveryPointSizeInGb = If( json?.PropertyT("recoveryPointSizeInGB"), out var __jsonRecoveryPointSizeInGb) ? (int?)__jsonRecoveryPointSizeInGb : RecoveryPointSizeInGb;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRecoveryPoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureFileShareRecoveryPoint(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __recoveryPoint?.ToJson(container, serializationMode); + AddIf( null != (((object)this._recoveryPointType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointType.ToString()) : null, "recoveryPointType" ,container.Add ); + AddIf( null != this._recoveryPointTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "recoveryPointTime" ,container.Add ); + AddIf( null != (((object)this._fileShareSnapshotUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._fileShareSnapshotUri.ToString()) : null, "fileShareSnapshotUri" ,container.Add ); + AddIf( null != this._recoveryPointSizeInGb ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._recoveryPointSizeInGb) : null, "recoveryPointSizeInGB" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRestoreRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRestoreRequest.cs new file mode 100644 index 000000000000..66f79a901c6d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRestoreRequest.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureFileShare Restore Request + public partial class AzureFileShareRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest __restoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions? _copyOption; + + /// Options to resolve copy conflicts. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions? CopyOption { get => this._copyOption; set => this._copyOption = value; } + + /// Internal Acessors for TargetDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRestoreRequestInternal.TargetDetail { get => (this._targetDetail = this._targetDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.TargetAfsRestoreInfo()); set { {_targetDetail = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__restoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__restoreRequest).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? _recoveryType; + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => this._recoveryType; set => this._recoveryType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecs[] _restoreFileSpec; + + /// + /// List of Source Files/Folders(which need to recover) and TargetFolderPath details + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecs[] RestoreFileSpec { get => this._restoreFileSpec; set => this._restoreFileSpec = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType? _restoreRequestType; + + /// Restore Type (FullShareRestore or ItemLevelRestore) + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType? RestoreRequestType { get => this._restoreRequestType; set => this._restoreRequestType = value; } + + /// Backing field for property. + private string _sourceResourceId; + + /// Source storage account ARM Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfo _targetDetail; + + /// Target File Share Details + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfo TargetDetail { get => (this._targetDetail = this._targetDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.TargetAfsRestoreInfo()); set => this._targetDetail = value; } + + /// File share name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string TargetDetailName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfoInternal)TargetDetail).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfoInternal)TargetDetail).Name = value ?? null; } + + /// Target file share resource ARM ID + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string TargetDetailTargetResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfoInternal)TargetDetail).TargetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfoInternal)TargetDetail).TargetResourceId = value ?? null; } + + /// Creates an new instance. + public AzureFileShareRestoreRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__restoreRequest), __restoreRequest); + await eventListener.AssertObjectIsValid(nameof(__restoreRequest), __restoreRequest); + } + } + /// AzureFileShare Restore Request + public partial interface IAzureFileShareRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest + { + /// Options to resolve copy conflicts. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Options to resolve copy conflicts.", + SerializedName = @"copyOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions? CopyOption { get; set; } + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of this recovery.", + SerializedName = @"recoveryType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get; set; } + /// + /// List of Source Files/Folders(which need to recover) and TargetFolderPath details + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Source Files/Folders(which need to recover) and TargetFolderPath details", + SerializedName = @"restoreFileSpecs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecs) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecs[] RestoreFileSpec { get; set; } + /// Restore Type (FullShareRestore or ItemLevelRestore) + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restore Type (FullShareRestore or ItemLevelRestore)", + SerializedName = @"restoreRequestType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType? RestoreRequestType { get; set; } + /// Source storage account ARM Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source storage account ARM Id", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + /// File share name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File share name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TargetDetailName { get; set; } + /// Target file share resource ARM ID + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target file share resource ARM ID", + SerializedName = @"targetResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetDetailTargetResourceId { get; set; } + + } + /// AzureFileShare Restore Request + internal partial interface IAzureFileShareRestoreRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal + { + /// Options to resolve copy conflicts. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions? CopyOption { get; set; } + /// Type of this recovery. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get; set; } + /// + /// List of Source Files/Folders(which need to recover) and TargetFolderPath details + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecs[] RestoreFileSpec { get; set; } + /// Restore Type (FullShareRestore or ItemLevelRestore) + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType? RestoreRequestType { get; set; } + /// Source storage account ARM Id + string SourceResourceId { get; set; } + /// Target File Share Details + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfo TargetDetail { get; set; } + /// File share name + string TargetDetailName { get; set; } + /// Target file share resource ARM ID + string TargetDetailTargetResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRestoreRequest.json.cs new file mode 100644 index 000000000000..df6f7be640e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileShareRestoreRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureFileShare Restore Request + public partial class AzureFileShareRestoreRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFileShareRestoreRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __restoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest(json); + {_targetDetail = If( json?.PropertyT("targetDetails"), out var __jsonTargetDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.TargetAfsRestoreInfo.FromJson(__jsonTargetDetails) : TargetDetail;} + {_recoveryType = If( json?.PropertyT("recoveryType"), out var __jsonRecoveryType) ? (string)__jsonRecoveryType : (string)RecoveryType;} + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + {_copyOption = If( json?.PropertyT("copyOptions"), out var __jsonCopyOptions) ? (string)__jsonCopyOptions : (string)CopyOption;} + {_restoreRequestType = If( json?.PropertyT("restoreRequestType"), out var __jsonRestoreRequestType) ? (string)__jsonRestoreRequestType : (string)RestoreRequestType;} + {_restoreFileSpec = If( json?.PropertyT("restoreFileSpecs"), out var __jsonRestoreFileSpecs) ? If( __jsonRestoreFileSpecs as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecs) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreFileSpecs.FromJson(__u) )) ))() : null : RestoreFileSpec;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRestoreRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileShareRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureFileShareRestoreRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __restoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._targetDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._targetDetail.ToJson(null,serializationMode) : null, "targetDetails" ,container.Add ); + AddIf( null != (((object)this._recoveryType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryType.ToString()) : null, "recoveryType" ,container.Add ); + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + AddIf( null != (((object)this._copyOption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._copyOption.ToString()) : null, "copyOptions" ,container.Add ); + AddIf( null != (((object)this._restoreRequestType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._restoreRequestType.ToString()) : null, "restoreRequestType" ,container.Add ); + if (null != this._restoreFileSpec) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._restoreFileSpec ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("restoreFileSpecs",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItem.cs new file mode 100644 index 000000000000..0967c086266e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItem.cs @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure File Share workload-specific backup item. + public partial class AzureFileshareProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfo _extendedInfo; + + /// Additional information with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureFileshareProtectedItemExtendedInfo()); set => this._extendedInfo = value; } + + /// The oldest backup copy available for this item in the service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyState = value ?? null; } + + /// Number of available backup copies associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount = value ?? default(int); } + + /// + /// Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoResourceState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).ResourceState; } + + /// The resource state sync time for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoResourceStateSyncTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).ResourceStateSyncTime; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the fileshare represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemKpisHealths _kpisHealth; + + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemKpisHealths KpisHealth { get => (this._kpisHealth = this._kpisHealth ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureFileshareProtectedItemKpisHealths()); set => this._kpisHealth = value; } + + /// Backing field for property. + private string _lastBackupStatus; + + /// Last backup operation status. Possible values: Healthy, Unhealthy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string LastBackupStatus { get => this._lastBackupStatus; set => this._lastBackupStatus = value; } + + /// Backing field for property. + private global::System.DateTime? _lastBackupTime; + + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? LastBackupTime { get => this._lastBackupTime; set => this._lastBackupTime = value; } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureFileshareProtectedItemExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Internal Acessors for ExtendedInfoResourceState + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemInternal.ExtendedInfoResourceState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).ResourceState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).ResourceState = value; } + + /// Internal Acessors for ExtendedInfoResourceStateSyncTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemInternal.ExtendedInfoResourceStateSyncTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).ResourceStateSyncTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).ResourceStateSyncTime = value; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? _protectionState; + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get => this._protectionState; set => this._protectionState = value; } + + /// Backing field for property. + private string _protectionStatus; + + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectionStatus { get => this._protectionStatus; set => this._protectionStatus = value; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type = value ; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public AzureFileshareProtectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectedItem), __protectedItem); + await eventListener.AssertObjectIsValid(nameof(__protectedItem), __protectedItem); + } + } + /// Azure File Share workload-specific backup item. + public partial interface IAzureFileshareProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem + { + /// The oldest backup copy available for this item in the service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this item in the service.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates consistency of policy object and policy applied to this backup item.", + SerializedName = @"policyState", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoPolicyState { get; set; } + /// Number of available backup copies associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of available backup copies associated with this backup item.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoRecoveryPointCount { get; set; } + /// + /// Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted}", + SerializedName = @"resourceState", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoResourceState { get; } + /// The resource state sync time for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resource state sync time for this backup item.", + SerializedName = @"resourceStateSyncTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoResourceStateSyncTime { get; } + /// Friendly name of the fileshare represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the fileshare represented by this backup item.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health details of different KPIs", + SerializedName = @"kpisHealths", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemKpisHealths) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemKpisHealths KpisHealth { get; set; } + /// Last backup operation status. Possible values: Healthy, Unhealthy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last backup operation status. Possible values: Healthy, Unhealthy.", + SerializedName = @"lastBackupStatus", + PossibleTypes = new [] { typeof(string) })] + string LastBackupStatus { get; set; } + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Timestamp of the last backup operation on this backup item.", + SerializedName = @"lastBackupTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastBackupTime { get; set; } + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup state of this backup item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get; set; } + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup status of this backup item.", + SerializedName = @"protectionStatus", + PossibleTypes = new [] { typeof(string) })] + string ProtectionStatus { get; set; } + + } + /// Azure File Share workload-specific backup item. + internal partial interface IAzureFileshareProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal + { + /// Additional information with this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfo ExtendedInfo { get; set; } + /// The oldest backup copy available for this item in the service. + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + string ExtendedInfoPolicyState { get; set; } + /// Number of available backup copies associated with this backup item. + int? ExtendedInfoRecoveryPointCount { get; set; } + /// + /// Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted} + /// + string ExtendedInfoResourceState { get; set; } + /// The resource state sync time for this backup item. + global::System.DateTime? ExtendedInfoResourceStateSyncTime { get; set; } + /// Friendly name of the fileshare represented by this backup item. + string FriendlyName { get; set; } + /// Health details of different KPIs + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemKpisHealths KpisHealth { get; set; } + /// Last backup operation status. Possible values: Healthy, Unhealthy. + string LastBackupStatus { get; set; } + /// Timestamp of the last backup operation on this backup item. + global::System.DateTime? LastBackupTime { get; set; } + /// Backup state of this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get; set; } + /// Backup status of this backup item. + string ProtectionStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItem.json.cs new file mode 100644 index 000000000000..6568662a7117 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure File Share workload-specific backup item. + public partial class AzureFileshareProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFileshareProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureFileshareProtectedItemExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_protectionStatus = If( json?.PropertyT("protectionStatus"), out var __jsonProtectionStatus) ? (string)__jsonProtectionStatus : (string)ProtectionStatus;} + {_protectionState = If( json?.PropertyT("protectionState"), out var __jsonProtectionState) ? (string)__jsonProtectionState : (string)ProtectionState;} + {_lastBackupStatus = If( json?.PropertyT("lastBackupStatus"), out var __jsonLastBackupStatus) ? (string)__jsonLastBackupStatus : (string)LastBackupStatus;} + {_lastBackupTime = If( json?.PropertyT("lastBackupTime"), out var __jsonLastBackupTime) ? global::System.DateTime.TryParse((string)__jsonLastBackupTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastBackupTimeValue) ? __jsonLastBackupTimeValue : LastBackupTime : LastBackupTime;} + {_kpisHealth = If( json?.PropertyT("kpisHealths"), out var __jsonKpisHealths) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureFileshareProtectedItemKpisHealths.FromJson(__jsonKpisHealths) : KpisHealth;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureFileshareProtectedItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectedItem?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._protectionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionStatus.ToString()) : null, "protectionStatus" ,container.Add ); + AddIf( null != (((object)this._protectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionState.ToString()) : null, "protectionState" ,container.Add ); + AddIf( null != (((object)this._lastBackupStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastBackupStatus.ToString()) : null, "lastBackupStatus" ,container.Add ); + AddIf( null != this._lastBackupTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastBackupTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastBackupTime" ,container.Add ); + AddIf( null != this._kpisHealth ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._kpisHealth.ToJson(null,serializationMode) : null, "kpisHealths" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..77b1ec23c212 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information about Azure File Share backup item. + public partial class AzureFileshareProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal + { + + /// Internal Acessors for ResourceState + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal.ResourceState { get => this._resourceState; set { {_resourceState = value;} } } + + /// Internal Acessors for ResourceStateSyncTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfoInternal.ResourceStateSyncTime { get => this._resourceStateSyncTime; set { {_resourceStateSyncTime = value;} } } + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPoint; + + /// The oldest backup copy available for this item in the service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OldestRecoveryPoint { get => this._oldestRecoveryPoint; set => this._oldestRecoveryPoint = value; } + + /// Backing field for property. + private string _policyState; + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyState { get => this._policyState; set => this._policyState = value; } + + /// Backing field for property. + private int? _recoveryPointCount; + + /// Number of available backup copies associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? RecoveryPointCount { get => this._recoveryPointCount; set => this._recoveryPointCount = value; } + + /// Backing field for property. + private string _resourceState; + + /// + /// Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceState { get => this._resourceState; } + + /// Backing field for property. + private global::System.DateTime? _resourceStateSyncTime; + + /// The resource state sync time for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? ResourceStateSyncTime { get => this._resourceStateSyncTime; } + + /// Creates an new instance. + public AzureFileshareProtectedItemExtendedInfo() + { + + } + } + /// Additional information about Azure File Share backup item. + public partial interface IAzureFileshareProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The oldest backup copy available for this item in the service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this item in the service.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates consistency of policy object and policy applied to this backup item.", + SerializedName = @"policyState", + PossibleTypes = new [] { typeof(string) })] + string PolicyState { get; set; } + /// Number of available backup copies associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of available backup copies associated with this backup item.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? RecoveryPointCount { get; set; } + /// + /// Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted}", + SerializedName = @"resourceState", + PossibleTypes = new [] { typeof(string) })] + string ResourceState { get; } + /// The resource state sync time for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resource state sync time for this backup item.", + SerializedName = @"resourceStateSyncTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ResourceStateSyncTime { get; } + + } + /// Additional information about Azure File Share backup item. + internal partial interface IAzureFileshareProtectedItemExtendedInfoInternal + + { + /// The oldest backup copy available for this item in the service. + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + string PolicyState { get; set; } + /// Number of available backup copies associated with this backup item. + int? RecoveryPointCount { get; set; } + /// + /// Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted} + /// + string ResourceState { get; set; } + /// The resource state sync time for this backup item. + global::System.DateTime? ResourceStateSyncTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..870f47beb19d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information about Azure File Share backup item. + public partial class AzureFileshareProtectedItemExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFileshareProtectedItemExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_oldestRecoveryPoint = If( json?.PropertyT("oldestRecoveryPoint"), out var __jsonOldestRecoveryPoint) ? global::System.DateTime.TryParse((string)__jsonOldestRecoveryPoint, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOldestRecoveryPointValue) ? __jsonOldestRecoveryPointValue : OldestRecoveryPoint : OldestRecoveryPoint;} + {_recoveryPointCount = If( json?.PropertyT("recoveryPointCount"), out var __jsonRecoveryPointCount) ? (int?)__jsonRecoveryPointCount : RecoveryPointCount;} + {_policyState = If( json?.PropertyT("policyState"), out var __jsonPolicyState) ? (string)__jsonPolicyState : (string)PolicyState;} + {_resourceState = If( json?.PropertyT("resourceState"), out var __jsonResourceState) ? (string)__jsonResourceState : (string)ResourceState;} + {_resourceStateSyncTime = If( json?.PropertyT("resourceStateSyncTime"), out var __jsonResourceStateSyncTime) ? global::System.DateTime.TryParse((string)__jsonResourceStateSyncTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonResourceStateSyncTimeValue) ? __jsonResourceStateSyncTimeValue : ResourceStateSyncTime : ResourceStateSyncTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureFileshareProtectedItemExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._oldestRecoveryPoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oldestRecoveryPoint?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "oldestRecoveryPoint" ,container.Add ); + AddIf( null != this._recoveryPointCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._recoveryPointCount) : null, "recoveryPointCount" ,container.Add ); + AddIf( null != (((object)this._policyState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyState.ToString()) : null, "policyState" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceState.ToString()) : null, "resourceState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._resourceStateSyncTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceStateSyncTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "resourceStateSyncTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.cs new file mode 100644 index 000000000000..5a2ed540dc54 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health details of different KPIs + public partial class AzureFileshareProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemKpisHealths, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemKpisHealthsInternal + { + + /// Creates an new instance. + public AzureFileshareProtectedItemKpisHealths() + { + + } + } + /// Health details of different KPIs + public partial interface IAzureFileshareProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Health details of different KPIs + internal partial interface IAzureFileshareProtectedItemKpisHealthsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.dictionary.cs new file mode 100644 index 000000000000..7704a460426b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AzureFileshareProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureFileshareProtectedItemKpisHealths source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.json.cs new file mode 100644 index 000000000000..39915b6f5621 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureFileshareProtectedItemKpisHealths.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health details of different KPIs + public partial class AzureFileshareProtectedItemKpisHealths + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureFileshareProtectedItemKpisHealths(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.KpiResourceHealthDetails.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemKpisHealths. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemKpisHealths. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureFileshareProtectedItemKpisHealths FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureFileshareProtectedItemKpisHealths(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmcontainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmcontainer.cs new file mode 100644 index 000000000000..9548313f86b7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmcontainer.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup item representing a classic virtual machine. + public partial class AzureIaaSClassicComputeVmcontainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmcontainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmcontainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainer __iaaSvmContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaaSvmContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).ContainerType = value ; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).HealthStatus = value ?? null; } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).ProtectableObjectType = value ?? null; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).RegistrationStatus = value ?? null; } + + /// Resource group name of Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).ResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).ResourceGroup = value ?? null; } + + /// + /// Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).VirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).VirtualMachineId = value ?? null; } + + /// + /// Specifies whether the container represents a Classic or an Azure Resource Manager VM. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualMachineVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).VirtualMachineVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).VirtualMachineVersion = value ?? null; } + + /// Creates an new instance. + public AzureIaaSClassicComputeVmcontainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__iaaSvmContainer), __iaaSvmContainer); + await eventListener.AssertObjectIsValid(nameof(__iaaSvmContainer), __iaaSvmContainer); + } + } + /// IaaS VM workload-specific backup item representing a classic virtual machine. + public partial interface IAzureIaaSClassicComputeVmcontainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainer + { + + } + /// IaaS VM workload-specific backup item representing a classic virtual machine. + internal partial interface IAzureIaaSClassicComputeVmcontainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmcontainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmcontainer.json.cs new file mode 100644 index 000000000000..7f4b5a12f504 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmcontainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup item representing a classic virtual machine. + public partial class AzureIaaSClassicComputeVmcontainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSClassicComputeVmcontainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __iaaSvmContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaaSvmContainer(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmcontainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmcontainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmcontainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSClassicComputeVmcontainer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __iaaSvmContainer?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectableItem.cs new file mode 100644 index 000000000000..55b13812a350 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectableItem.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + public partial class AzureIaaSClassicComputeVmprotectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmprotectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmprotectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItem __iaaSvmProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaaSvmProtectableItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).FriendlyName = value ?? null; } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Resource group name of Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).ResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).ResourceGroup = value ?? null; } + + /// Fully qualified ARM ID of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).VirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).VirtualMachineId = value ?? null; } + + /// + /// Specifies whether the container represents a Classic or an Azure Resource Manager VM. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualMachineVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).VirtualMachineVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).VirtualMachineVersion = value ?? null; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).WorkloadType = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureIaaSClassicComputeVmprotectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__iaaSvmProtectableItem), __iaaSvmProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__iaaSvmProtectableItem), __iaaSvmProtectableItem); + } + } + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + public partial interface IAzureIaaSClassicComputeVmprotectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItem + { + + } + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + internal partial interface IAzureIaaSClassicComputeVmprotectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectableItem.json.cs new file mode 100644 index 000000000000..4a021886c25c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + public partial class AzureIaaSClassicComputeVmprotectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSClassicComputeVmprotectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __iaaSvmProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaaSvmProtectableItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmprotectableItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmprotectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmprotectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSClassicComputeVmprotectableItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __iaaSvmProtectableItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectedItem.cs new file mode 100644 index 000000000000..d12b6fc1e1b1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectedItem.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + public partial class AzureIaaSClassicComputeVmprotectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmprotectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmprotectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItem __azureIaaSvmProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int[] DiskExclusionPropertyDiskLunList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyDiskLunList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyDiskLunList = value ?? null /* arrayOf */; } + + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? DiskExclusionPropertyIsInclusionList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyIsInclusionList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyIsInclusionList = value ?? default(bool); } + + /// Additional information for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfo = value ?? null /* model class */; } + + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoNewestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoNewestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPointInVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPointInVault = value ?? default(global::System.DateTime); } + + /// Specifies if backup policy associated with the backup item is inconsistent. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? ExtendedInfoPolicyInconsistent { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoPolicyInconsistent; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoPolicyInconsistent = value ?? default(bool); } + + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoRecoveryPointCount = value ?? default(int); } + + /// Extended Properties for Azure IaasVM Backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedProperties ExtendedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedProperty = value ?? null /* model class */; } + + /// Extended Properties for Disk Exclusion. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties ExtendedPropertyDiskExclusionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyDiskExclusionProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyDiskExclusionProperty = value ?? null /* model class */; } + + /// Linux VM name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedPropertyLinuxVMApplicationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyLinuxVMApplicationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyLinuxVMApplicationName = value ?? null; } + + /// Friendly name of the VM represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).FriendlyName = value ?? null; } + + /// Health details on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails[] HealthDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthDetail = value ?? null /* arrayOf */; } + + /// Health status of protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus? HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus)""); } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths KpisHealth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).KpisHealth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).KpisHealth = value ?? null /* model class */; } + + /// Last backup operation status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string LastBackupStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupStatus = value ?? null; } + + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastBackupTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupTime = value ?? default(global::System.DateTime); } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyName = value ?? null; } + + /// Data ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectedItemDataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectedItemDataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectedItemDataId = value ?? null; } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState)""); } + + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionStatus = value ?? null; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).Type = value ; } + + /// Fully qualified ARM ID of the virtual machine represented by this item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).VirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).VirtualMachineId = value ?? null; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public AzureIaaSClassicComputeVmprotectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureIaaSvmProtectedItem), __azureIaaSvmProtectedItem); + await eventListener.AssertObjectIsValid(nameof(__azureIaaSvmProtectedItem), __azureIaaSvmProtectedItem); + } + } + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + public partial interface IAzureIaaSClassicComputeVmprotectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItem + { + + } + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + internal partial interface IAzureIaaSClassicComputeVmprotectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectedItem.json.cs new file mode 100644 index 000000000000..a0b8d853df32 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSClassicComputeVmprotectedItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + public partial class AzureIaaSClassicComputeVmprotectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSClassicComputeVmprotectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureIaaSvmProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectedItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmprotectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmprotectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSClassicComputeVmprotectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSClassicComputeVmprotectedItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureIaaSvmProtectedItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmcontainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmcontainer.cs new file mode 100644 index 000000000000..2ea4266b88b1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmcontainer.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// IaaS VM workload-specific backup item representing an Azure Resource Manager virtual machine. + /// + public partial class AzureIaaSComputeVmcontainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmcontainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmcontainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainer __iaaSvmContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaaSvmContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).ContainerType = value ; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).HealthStatus = value ?? null; } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).ProtectableObjectType = value ?? null; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__iaaSvmContainer).RegistrationStatus = value ?? null; } + + /// Resource group name of Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).ResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).ResourceGroup = value ?? null; } + + /// + /// Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).VirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).VirtualMachineId = value ?? null; } + + /// + /// Specifies whether the container represents a Classic or an Azure Resource Manager VM. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualMachineVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).VirtualMachineVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal)__iaaSvmContainer).VirtualMachineVersion = value ?? null; } + + /// Creates an new instance. + public AzureIaaSComputeVmcontainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__iaaSvmContainer), __iaaSvmContainer); + await eventListener.AssertObjectIsValid(nameof(__iaaSvmContainer), __iaaSvmContainer); + } + } + /// IaaS VM workload-specific backup item representing an Azure Resource Manager virtual machine. + public partial interface IAzureIaaSComputeVmcontainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainer + { + + } + /// IaaS VM workload-specific backup item representing an Azure Resource Manager virtual machine. + internal partial interface IAzureIaaSComputeVmcontainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmcontainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmcontainer.json.cs new file mode 100644 index 000000000000..699250e5c407 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmcontainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// IaaS VM workload-specific backup item representing an Azure Resource Manager virtual machine. + /// + public partial class AzureIaaSComputeVmcontainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSComputeVmcontainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __iaaSvmContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaaSvmContainer(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmcontainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmcontainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmcontainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSComputeVmcontainer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __iaaSvmContainer?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectableItem.cs new file mode 100644 index 000000000000..291d7df3ff35 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectableItem.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + /// + public partial class AzureIaaSComputeVmprotectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmprotectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmprotectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItem __iaaSvmProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaaSvmProtectableItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).FriendlyName = value ?? null; } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Resource group name of Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).ResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).ResourceGroup = value ?? null; } + + /// Fully qualified ARM ID of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).VirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).VirtualMachineId = value ?? null; } + + /// + /// Specifies whether the container represents a Classic or an Azure Resource Manager VM. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualMachineVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).VirtualMachineVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal)__iaaSvmProtectableItem).VirtualMachineVersion = value ?? null; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__iaaSvmProtectableItem).WorkloadType = value ?? null; } + + /// Creates an new instance. + public AzureIaaSComputeVmprotectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__iaaSvmProtectableItem), __iaaSvmProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__iaaSvmProtectableItem), __iaaSvmProtectableItem); + } + } + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + public partial interface IAzureIaaSComputeVmprotectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItem + { + + } + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + internal partial interface IAzureIaaSComputeVmprotectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectableItem.json.cs new file mode 100644 index 000000000000..6a510ba59a14 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + /// + public partial class AzureIaaSComputeVmprotectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSComputeVmprotectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __iaaSvmProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaaSvmProtectableItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmprotectableItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmprotectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmprotectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSComputeVmprotectableItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __iaaSvmProtectableItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectedItem.cs new file mode 100644 index 000000000000..ad21a2a5e400 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectedItem.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + /// + public partial class AzureIaaSComputeVmprotectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmprotectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmprotectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItem __azureIaaSvmProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int[] DiskExclusionPropertyDiskLunList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyDiskLunList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyDiskLunList = value ?? null /* arrayOf */; } + + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? DiskExclusionPropertyIsInclusionList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyIsInclusionList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyIsInclusionList = value ?? default(bool); } + + /// Additional information for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfo = value ?? null /* model class */; } + + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoNewestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoNewestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPointInVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPointInVault = value ?? default(global::System.DateTime); } + + /// Specifies if backup policy associated with the backup item is inconsistent. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? ExtendedInfoPolicyInconsistent { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoPolicyInconsistent; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoPolicyInconsistent = value ?? default(bool); } + + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoRecoveryPointCount = value ?? default(int); } + + /// Extended Properties for Azure IaasVM Backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedProperties ExtendedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedProperty = value ?? null /* model class */; } + + /// Extended Properties for Disk Exclusion. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties ExtendedPropertyDiskExclusionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyDiskExclusionProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyDiskExclusionProperty = value ?? null /* model class */; } + + /// Linux VM name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedPropertyLinuxVMApplicationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyLinuxVMApplicationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyLinuxVMApplicationName = value ?? null; } + + /// Friendly name of the VM represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).FriendlyName = value ?? null; } + + /// Health details on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails[] HealthDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthDetail = value ?? null /* arrayOf */; } + + /// Health status of protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus? HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus)""); } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths KpisHealth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).KpisHealth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).KpisHealth = value ?? null /* model class */; } + + /// Last backup operation status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string LastBackupStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupStatus = value ?? null; } + + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastBackupTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupTime = value ?? default(global::System.DateTime); } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyName = value ?? null; } + + /// Data ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectedItemDataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectedItemDataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectedItemDataId = value ?? null; } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState)""); } + + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionStatus = value ?? null; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).Type = value ; } + + /// Fully qualified ARM ID of the virtual machine represented by this item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).VirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).VirtualMachineId = value ?? null; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureIaaSvmProtectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public AzureIaaSComputeVmprotectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureIaaSvmProtectedItem), __azureIaaSvmProtectedItem); + await eventListener.AssertObjectIsValid(nameof(__azureIaaSvmProtectedItem), __azureIaaSvmProtectedItem); + } + } + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + public partial interface IAzureIaaSComputeVmprotectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItem + { + + } + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + internal partial interface IAzureIaaSComputeVmprotectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectedItem.json.cs new file mode 100644 index 000000000000..b921bc27f5ca --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSComputeVmprotectedItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + /// + public partial class AzureIaaSComputeVmprotectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSComputeVmprotectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureIaaSvmProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectedItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmprotectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmprotectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSComputeVmprotectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSComputeVmprotectedItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureIaaSvmProtectedItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmErrorInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmErrorInfo.cs new file mode 100644 index 000000000000..a4eb16df5d09 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmErrorInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific error information. + public partial class AzureIaaSvmErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfoInternal + { + + /// Backing field for property. + private int? _errorCode; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? ErrorCode { get => this._errorCode; } + + /// Backing field for property. + private string _errorString; + + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorString { get => this._errorString; } + + /// Backing field for property. + private string _errorTitle; + + /// Title: Typically, the entity that the error pertains to. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorTitle { get => this._errorTitle; } + + /// Internal Acessors for ErrorCode + int? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfoInternal.ErrorCode { get => this._errorCode; set { {_errorCode = value;} } } + + /// Internal Acessors for ErrorString + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfoInternal.ErrorString { get => this._errorString; set { {_errorString = value;} } } + + /// Internal Acessors for ErrorTitle + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfoInternal.ErrorTitle { get => this._errorTitle; set { {_errorTitle = value;} } } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfoInternal.Recommendation { get => this._recommendation; set { {_recommendation = value;} } } + + /// Backing field for property. + private string[] _recommendation; + + /// List of localized recommendations for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; } + + /// Creates an new instance. + public AzureIaaSvmErrorInfo() + { + + } + } + /// Azure IaaS VM workload-specific error information. + public partial interface IAzureIaaSvmErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(int) })] + int? ErrorCode { get; } + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Localized error string.", + SerializedName = @"errorString", + PossibleTypes = new [] { typeof(string) })] + string ErrorString { get; } + /// Title: Typically, the entity that the error pertains to. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Title: Typically, the entity that the error pertains to.", + SerializedName = @"errorTitle", + PossibleTypes = new [] { typeof(string) })] + string ErrorTitle { get; } + /// List of localized recommendations for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of localized recommendations for above error code.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; } + + } + /// Azure IaaS VM workload-specific error information. + internal partial interface IAzureIaaSvmErrorInfoInternal + + { + /// Error code. + int? ErrorCode { get; set; } + /// Localized error string. + string ErrorString { get; set; } + /// Title: Typically, the entity that the error pertains to. + string ErrorTitle { get; set; } + /// List of localized recommendations for above error code. + string[] Recommendation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmErrorInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmErrorInfo.json.cs new file mode 100644 index 000000000000..bd837dc49e1b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmErrorInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific error information. + public partial class AzureIaaSvmErrorInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSvmErrorInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (int?)__jsonErrorCode : ErrorCode;} + {_errorTitle = If( json?.PropertyT("errorTitle"), out var __jsonErrorTitle) ? (string)__jsonErrorTitle : (string)ErrorTitle;} + {_errorString = If( json?.PropertyT("errorString"), out var __jsonErrorString) ? (string)__jsonErrorString : (string)ErrorString;} + {_recommendation = If( json?.PropertyT("recommendations"), out var __jsonRecommendations) ? If( __jsonRecommendations as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Recommendation;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmErrorInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._errorCode ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._errorCode) : null, "errorCode" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorTitle)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorTitle.ToString()) : null, "errorTitle" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorString.ToString()) : null, "errorString" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmHealthDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmHealthDetails.cs new file mode 100644 index 000000000000..598b282bf1ad --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmHealthDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific Health Details. + public partial class AzureIaaSvmHealthDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmHealthDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmHealthDetailsInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails __resourceHealthDetails = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceHealthDetails(); + + /// Health Code + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Code; } + + /// Health Message + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Message; } + + /// Internal Acessors for Code + int? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Code = value; } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Message = value; } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal.Recommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Recommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Recommendation = value; } + + /// Internal Acessors for Title + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal.Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Title = value; } + + /// Health Recommended Actions + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] Recommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Recommendation; } + + /// Health Title + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal)__resourceHealthDetails).Title; } + + /// Creates an new instance. + public AzureIaaSvmHealthDetails() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceHealthDetails), __resourceHealthDetails); + await eventListener.AssertObjectIsValid(nameof(__resourceHealthDetails), __resourceHealthDetails); + } + } + /// Azure IaaS VM workload-specific Health Details. + public partial interface IAzureIaaSvmHealthDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails + { + + } + /// Azure IaaS VM workload-specific Health Details. + internal partial interface IAzureIaaSvmHealthDetailsInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmHealthDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmHealthDetails.json.cs new file mode 100644 index 000000000000..82decc386050 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmHealthDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific Health Details. + public partial class AzureIaaSvmHealthDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSvmHealthDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceHealthDetails = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceHealthDetails(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmHealthDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmHealthDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmHealthDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmHealthDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceHealthDetails?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJob.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJob.cs new file mode 100644 index 000000000000..4a84737f638a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJob.cs @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific job object. + public partial class AzureIaaSvmJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] _actionsInfo; + + /// Gets or sets the state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get => this._actionsInfo; set => this._actionsInfo = value; } + + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ActivityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId = value ?? null; } + + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Backing field for property. + private string _containerName; + + /// Container name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private global::System.TimeSpan? _duration; + + /// Time elapsed during the execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.TimeSpan? Duration { get => this._duration; set => this._duration = value; } + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? EndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime = value ?? default(global::System.DateTime); } + + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EntityFriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo[] _errorDetail; + + /// Error details on execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo _extendedInfo; + + /// Additional information for this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfo()); set => this._extendedInfo = value; } + + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoDynamicErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage = value ?? null; } + + /// Time remaining for execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoEstimatedRemainingDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).EstimatedRemainingDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).EstimatedRemainingDuration = value ?? null; } + + /// Job internal properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag ExtendedInfoInternalPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).InternalPropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).InternalPropertyBag = value ?? null /* model class */; } + + /// Indicates progress of the job. Null if it has not started or completed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public double? ExtendedInfoProgressPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).ProgressPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).ProgressPercentage = value ?? default(double); } + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).PropertyBag = value ?? null /* model class */; } + + /// List of tasks associated with this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).TasksList = value ?? null /* arrayOf */; } + + /// Backing field for property. + private bool? _isUserTriggered; + + /// Indicated that whether the job is adhoc(true) or scheduled(false) + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsUserTriggered { get => this._isUserTriggered; set => this._isUserTriggered = value; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfo()); set { {_extendedInfo = value;} } } + + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Operation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation = value ?? null; } + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime = value ?? default(global::System.DateTime); } + + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status = value ?? null; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type = value ; } + + /// Backing field for property. + private string _virtualMachineVersion; + + /// Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VirtualMachineVersion { get => this._virtualMachineVersion; set => this._virtualMachineVersion = value; } + + /// Creates an new instance. + public AzureIaaSvmJob() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__job), __job); + await eventListener.AssertObjectIsValid(nameof(__job), __job); + } + } + /// Azure IaaS VM workload-specific job object. + public partial interface IAzureIaaSvmJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob + { + /// Gets or sets the state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the state/actions applicable on this job like cancel/retry.", + SerializedName = @"actionsInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Container name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container name of the entity on which the current job is executing.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Time elapsed during the execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time elapsed during the execution of this job.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Duration { get; set; } + /// Error details on execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error details on execution of this job.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo[] ErrorDetail { get; set; } + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message on job execution.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoDynamicErrorMessage { get; set; } + /// Time remaining for execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time remaining for execution of this job.", + SerializedName = @"estimatedRemainingDuration", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoEstimatedRemainingDuration { get; set; } + /// Job internal properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job internal properties.", + SerializedName = @"internalPropertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag ExtendedInfoInternalPropertyBag { get; set; } + /// Indicates progress of the job. Null if it has not started or completed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates progress of the job. Null if it has not started or completed.", + SerializedName = @"progressPercentage", + PossibleTypes = new [] { typeof(double) })] + double? ExtendedInfoProgressPercentage { get; set; } + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks associated with this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks associated with this job.", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Indicated that whether the job is adhoc(true) or scheduled(false) + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicated that whether the job is adhoc(true) or scheduled(false)", + SerializedName = @"isUserTriggered", + PossibleTypes = new [] { typeof(bool) })] + bool? IsUserTriggered { get; set; } + /// Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether the backup item is a Classic or an Azure Resource Manager VM.", + SerializedName = @"virtualMachineVersion", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineVersion { get; set; } + + } + /// Azure IaaS VM workload-specific job object. + internal partial interface IAzureIaaSvmJobInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal + { + /// Gets or sets the state/actions applicable on this job like cancel/retry. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Container name of the entity on which the current job is executing. + string ContainerName { get; set; } + /// Time elapsed during the execution of this job. + global::System.TimeSpan? Duration { get; set; } + /// Error details on execution of this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo[] ErrorDetail { get; set; } + /// Additional information for this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo ExtendedInfo { get; set; } + /// Non localized error message on job execution. + string ExtendedInfoDynamicErrorMessage { get; set; } + /// Time remaining for execution of this job. + string ExtendedInfoEstimatedRemainingDuration { get; set; } + /// Job internal properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag ExtendedInfoInternalPropertyBag { get; set; } + /// Indicates progress of the job. Null if it has not started or completed. + double? ExtendedInfoProgressPercentage { get; set; } + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks associated with this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Indicated that whether the job is adhoc(true) or scheduled(false) + bool? IsUserTriggered { get; set; } + /// Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + string VirtualMachineVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJob.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJob.json.cs new file mode 100644 index 000000000000..89f97bebf683 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJob.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific job object. + public partial class AzureIaaSvmJob + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSvmJob(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonDuration ) : Duration;} + {_actionsInfo = If( json?.PropertyT("actionsInfo"), out var __jsonActionsInfo) ? If( __jsonActionsInfo as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)""))) ))() : null : ActionsInfo;} + {_errorDetail = If( json?.PropertyT("errorDetails"), out var __jsonErrorDetails) ? If( __jsonErrorDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmErrorInfo.FromJson(__p) )) ))() : null : ErrorDetail;} + {_virtualMachineVersion = If( json?.PropertyT("virtualMachineVersion"), out var __jsonVirtualMachineVersion) ? (string)__jsonVirtualMachineVersion : (string)VirtualMachineVersion;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_isUserTriggered = If( json?.PropertyT("isUserTriggered"), out var __jsonIsUserTriggered) ? (bool?)__jsonIsUserTriggered : IsUserTriggered;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJob FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmJob(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __job?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)(null != this._duration ? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._duration)): null), "duration" ,container.Add ); + if (null != this._actionsInfo) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._actionsInfo ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("actionsInfo",__w); + } + if (null != this._errorDetail) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._errorDetail ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("errorDetails",__r); + } + AddIf( null != (((object)this._virtualMachineVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._virtualMachineVersion.ToString()) : null, "virtualMachineVersion" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != this._isUserTriggered ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isUserTriggered) : null, "isUserTriggered" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfo.cs new file mode 100644 index 000000000000..35aaab474c00 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific additional information for job. + public partial class AzureIaaSvmJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal + { + + /// Backing field for property. + private string _dynamicErrorMessage; + + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DynamicErrorMessage { get => this._dynamicErrorMessage; set => this._dynamicErrorMessage = value; } + + /// Backing field for property. + private string _estimatedRemainingDuration; + + /// Time remaining for execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string EstimatedRemainingDuration { get => this._estimatedRemainingDuration; set => this._estimatedRemainingDuration = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag _internalPropertyBag; + + /// Job internal properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag InternalPropertyBag { get => (this._internalPropertyBag = this._internalPropertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfoInternalPropertyBag()); set => this._internalPropertyBag = value; } + + /// Backing field for property. + private double? _progressPercentage; + + /// Indicates progress of the job. Null if it has not started or completed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public double? ProgressPercentage { get => this._progressPercentage; set => this._progressPercentage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag _propertyBag; + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails[] _tasksList; + + /// List of tasks associated with this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails[] TasksList { get => this._tasksList; set => this._tasksList = value; } + + /// Creates an new instance. + public AzureIaaSvmJobExtendedInfo() + { + + } + } + /// Azure IaaS VM workload-specific additional information for job. + public partial interface IAzureIaaSvmJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message on job execution.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string DynamicErrorMessage { get; set; } + /// Time remaining for execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time remaining for execution of this job.", + SerializedName = @"estimatedRemainingDuration", + PossibleTypes = new [] { typeof(string) })] + string EstimatedRemainingDuration { get; set; } + /// Job internal properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job internal properties.", + SerializedName = @"internalPropertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag InternalPropertyBag { get; set; } + /// Indicates progress of the job. Null if it has not started or completed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates progress of the job. Null if it has not started or completed.", + SerializedName = @"progressPercentage", + PossibleTypes = new [] { typeof(double) })] + double? ProgressPercentage { get; set; } + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks associated with this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks associated with this job.", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails[] TasksList { get; set; } + + } + /// Azure IaaS VM workload-specific additional information for job. + internal partial interface IAzureIaaSvmJobExtendedInfoInternal + + { + /// Non localized error message on job execution. + string DynamicErrorMessage { get; set; } + /// Time remaining for execution of this job. + string EstimatedRemainingDuration { get; set; } + /// Job internal properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag InternalPropertyBag { get; set; } + /// Indicates progress of the job. Null if it has not started or completed. + double? ProgressPercentage { get; set; } + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks associated with this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails[] TasksList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfo.json.cs new file mode 100644 index 000000000000..93b1ea6487ac --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific additional information for job. + public partial class AzureIaaSvmJobExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSvmJobExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tasksList = If( json?.PropertyT("tasksList"), out var __jsonTasksList) ? If( __jsonTasksList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobTaskDetails.FromJson(__u) )) ))() : null : TasksList;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfoPropertyBag.FromJson(__jsonPropertyBag) : PropertyBag;} + {_internalPropertyBag = If( json?.PropertyT("internalPropertyBag"), out var __jsonInternalPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfoInternalPropertyBag.FromJson(__jsonInternalPropertyBag) : InternalPropertyBag;} + {_progressPercentage = If( json?.PropertyT("progressPercentage"), out var __jsonProgressPercentage) ? (double?)__jsonProgressPercentage : ProgressPercentage;} + {_estimatedRemainingDuration = If( json?.PropertyT("estimatedRemainingDuration"), out var __jsonEstimatedRemainingDuration) ? (string)__jsonEstimatedRemainingDuration : (string)EstimatedRemainingDuration;} + {_dynamicErrorMessage = If( json?.PropertyT("dynamicErrorMessage"), out var __jsonDynamicErrorMessage) ? (string)__jsonDynamicErrorMessage : (string)DynamicErrorMessage;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmJobExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._tasksList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._tasksList ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("tasksList",__w); + } + AddIf( null != this._propertyBag ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._propertyBag.ToJson(null,serializationMode) : null, "propertyBag" ,container.Add ); + AddIf( null != this._internalPropertyBag ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._internalPropertyBag.ToJson(null,serializationMode) : null, "internalPropertyBag" ,container.Add ); + AddIf( null != this._progressPercentage ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((double)this._progressPercentage) : null, "progressPercentage" ,container.Add ); + AddIf( null != (((object)this._estimatedRemainingDuration)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._estimatedRemainingDuration.ToString()) : null, "estimatedRemainingDuration" ,container.Add ); + AddIf( null != (((object)this._dynamicErrorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dynamicErrorMessage.ToString()) : null, "dynamicErrorMessage" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.cs new file mode 100644 index 000000000000..a2a9fdc1c3d3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job internal properties. + public partial class AzureIaaSvmJobExtendedInfoInternalPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBagInternal + { + + /// + /// Creates an new instance. + /// + public AzureIaaSvmJobExtendedInfoInternalPropertyBag() + { + + } + } + /// Job internal properties. + public partial interface IAzureIaaSvmJobExtendedInfoInternalPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Job internal properties. + internal partial interface IAzureIaaSvmJobExtendedInfoInternalPropertyBagInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.dictionary.cs new file mode 100644 index 000000000000..37fe0d9a4fb3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AzureIaaSvmJobExtendedInfoInternalPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfoInternalPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.json.cs new file mode 100644 index 000000000000..4798b3a1272d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoInternalPropertyBag.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job internal properties. + public partial class AzureIaaSvmJobExtendedInfoInternalPropertyBag + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureIaaSvmJobExtendedInfoInternalPropertyBag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmJobExtendedInfoInternalPropertyBag(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..b1b193994dbe --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class AzureIaaSvmJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBagInternal + { + + /// Creates an new instance. + public AzureIaaSvmJobExtendedInfoPropertyBag() + { + + } + } + /// Job properties. + public partial interface IAzureIaaSvmJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Job properties. + internal partial interface IAzureIaaSvmJobExtendedInfoPropertyBagInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..ab311cf744bd --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AzureIaaSvmJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..cb4a9510fb6e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobExtendedInfoPropertyBag.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class AzureIaaSvmJobExtendedInfoPropertyBag + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureIaaSvmJobExtendedInfoPropertyBag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmJobExtendedInfoPropertyBag(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobTaskDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobTaskDetails.cs new file mode 100644 index 000000000000..8a1563389676 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobTaskDetails.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific job task details. + public partial class AzureIaaSvmJobTaskDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetailsInternal + { + + /// Backing field for property. + private global::System.TimeSpan? _duration; + + /// Time elapsed for task. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.TimeSpan? Duration { get => this._duration; set => this._duration = value; } + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } + + /// Backing field for property. + private string _instanceId; + + /// The instanceId. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string InstanceId { get => this._instanceId; set => this._instanceId = value; } + + /// Backing field for property. + private double? _progressPercentage; + + /// Progress of the task. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public double? ProgressPercentage { get => this._progressPercentage; set => this._progressPercentage = value; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private string _status; + + /// The status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string _taskExecutionDetail; + + /// + /// Details about execution of the task. + /// eg: number of bytes transferred etc + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TaskExecutionDetail { get => this._taskExecutionDetail; set => this._taskExecutionDetail = value; } + + /// Backing field for property. + private string _taskId; + + /// The task display name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Creates an new instance. + public AzureIaaSvmJobTaskDetails() + { + + } + } + /// Azure IaaS VM workload-specific job task details. + public partial interface IAzureIaaSvmJobTaskDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Time elapsed for task. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time elapsed for task.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Duration { get; set; } + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end time.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// The instanceId. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The instanceId.", + SerializedName = @"instanceId", + PossibleTypes = new [] { typeof(string) })] + string InstanceId { get; set; } + /// Progress of the task. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Progress of the task.", + SerializedName = @"progressPercentage", + PossibleTypes = new [] { typeof(double) })] + double? ProgressPercentage { get; set; } + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// The status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + /// + /// Details about execution of the task. + /// eg: number of bytes transferred etc + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Details about execution of the task. + eg: number of bytes transferred etc", + SerializedName = @"taskExecutionDetails", + PossibleTypes = new [] { typeof(string) })] + string TaskExecutionDetail { get; set; } + /// The task display name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The task display name.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// Azure IaaS VM workload-specific job task details. + internal partial interface IAzureIaaSvmJobTaskDetailsInternal + + { + /// Time elapsed for task. + global::System.TimeSpan? Duration { get; set; } + /// The end time. + global::System.DateTime? EndTime { get; set; } + /// The instanceId. + string InstanceId { get; set; } + /// Progress of the task. + double? ProgressPercentage { get; set; } + /// The start time. + global::System.DateTime? StartTime { get; set; } + /// The status. + string Status { get; set; } + /// + /// Details about execution of the task. + /// eg: number of bytes transferred etc + /// + string TaskExecutionDetail { get; set; } + /// The task display name. + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobTaskDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobTaskDetails.json.cs new file mode 100644 index 000000000000..72e173957a38 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobTaskDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific job task details. + public partial class AzureIaaSvmJobTaskDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSvmJobTaskDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} + {_instanceId = If( json?.PropertyT("instanceId"), out var __jsonInstanceId) ? (string)__jsonInstanceId : (string)InstanceId;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonDuration ) : Duration;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_progressPercentage = If( json?.PropertyT("progressPercentage"), out var __jsonProgressPercentage) ? (double?)__jsonProgressPercentage : ProgressPercentage;} + {_taskExecutionDetail = If( json?.PropertyT("taskExecutionDetails"), out var __jsonTaskExecutionDetails) ? (string)__jsonTaskExecutionDetails : (string)TaskExecutionDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmJobTaskDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + AddIf( null != (((object)this._instanceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._instanceId.ToString()) : null, "instanceId" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)(null != this._duration ? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._duration)): null), "duration" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._progressPercentage ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((double)this._progressPercentage) : null, "progressPercentage" ,container.Add ); + AddIf( null != (((object)this._taskExecutionDetail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._taskExecutionDetail.ToString()) : null, "taskExecutionDetails" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobV2.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobV2.cs new file mode 100644 index 000000000000..63f410b9fa72 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobV2.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific job object. + public partial class AzureIaaSvmJobV2 : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobV2, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobV2Internal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] _actionsInfo; + + /// Gets or sets the state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get => this._actionsInfo; set => this._actionsInfo = value; } + + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ActivityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId = value ?? null; } + + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Backing field for property. + private string _containerName; + + /// Container name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private global::System.TimeSpan? _duration; + + /// Time elapsed during the execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.TimeSpan? Duration { get => this._duration; set => this._duration = value; } + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? EndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime = value ?? default(global::System.DateTime); } + + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EntityFriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo[] _errorDetail; + + /// Error details on execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo _extendedInfo; + + /// Additional information for this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfo()); set => this._extendedInfo = value; } + + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoDynamicErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage = value ?? null; } + + /// Time remaining for execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoEstimatedRemainingDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).EstimatedRemainingDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).EstimatedRemainingDuration = value ?? null; } + + /// Job internal properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag ExtendedInfoInternalPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).InternalPropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).InternalPropertyBag = value ?? null /* model class */; } + + /// Indicates progress of the job. Null if it has not started or completed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public double? ExtendedInfoProgressPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).ProgressPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).ProgressPercentage = value ?? default(double); } + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).PropertyBag = value ?? null /* model class */; } + + /// List of tasks associated with this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).TasksList = value ?? null /* arrayOf */; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobV2Internal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfo()); set { {_extendedInfo = value;} } } + + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Operation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation = value ?? null; } + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime = value ?? default(global::System.DateTime); } + + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status = value ?? null; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type = value ; } + + /// Backing field for property. + private string _virtualMachineVersion; + + /// Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VirtualMachineVersion { get => this._virtualMachineVersion; set => this._virtualMachineVersion = value; } + + /// Creates an new instance. + public AzureIaaSvmJobV2() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__job), __job); + await eventListener.AssertObjectIsValid(nameof(__job), __job); + } + } + /// Azure IaaS VM workload-specific job object. + public partial interface IAzureIaaSvmJobV2 : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob + { + /// Gets or sets the state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the state/actions applicable on this job like cancel/retry.", + SerializedName = @"actionsInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Container name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container name of the entity on which the current job is executing.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Time elapsed during the execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time elapsed during the execution of this job.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Duration { get; set; } + /// Error details on execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error details on execution of this job.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo[] ErrorDetail { get; set; } + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message on job execution.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoDynamicErrorMessage { get; set; } + /// Time remaining for execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time remaining for execution of this job.", + SerializedName = @"estimatedRemainingDuration", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoEstimatedRemainingDuration { get; set; } + /// Job internal properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job internal properties.", + SerializedName = @"internalPropertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag ExtendedInfoInternalPropertyBag { get; set; } + /// Indicates progress of the job. Null if it has not started or completed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates progress of the job. Null if it has not started or completed.", + SerializedName = @"progressPercentage", + PossibleTypes = new [] { typeof(double) })] + double? ExtendedInfoProgressPercentage { get; set; } + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks associated with this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks associated with this job.", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether the backup item is a Classic or an Azure Resource Manager VM.", + SerializedName = @"virtualMachineVersion", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineVersion { get; set; } + + } + /// Azure IaaS VM workload-specific job object. + internal partial interface IAzureIaaSvmJobV2Internal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal + { + /// Gets or sets the state/actions applicable on this job like cancel/retry. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Container name of the entity on which the current job is executing. + string ContainerName { get; set; } + /// Time elapsed during the execution of this job. + global::System.TimeSpan? Duration { get; set; } + /// Error details on execution of this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo[] ErrorDetail { get; set; } + /// Additional information for this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfo ExtendedInfo { get; set; } + /// Non localized error message on job execution. + string ExtendedInfoDynamicErrorMessage { get; set; } + /// Time remaining for execution of this job. + string ExtendedInfoEstimatedRemainingDuration { get; set; } + /// Job internal properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoInternalPropertyBag ExtendedInfoInternalPropertyBag { get; set; } + /// Indicates progress of the job. Null if it has not started or completed. + double? ExtendedInfoProgressPercentage { get; set; } + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks associated with this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + string VirtualMachineVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobV2.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobV2.json.cs new file mode 100644 index 000000000000..4f510940c1b7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmJobV2.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure IaaS VM workload-specific job object. + public partial class AzureIaaSvmJobV2 + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSvmJobV2(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmJobExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_actionsInfo = If( json?.PropertyT("actionsInfo"), out var __jsonActionsInfo) ? If( __jsonActionsInfo as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)""))) ))() : null : ActionsInfo;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonDuration ) : Duration;} + {_errorDetail = If( json?.PropertyT("errorDetails"), out var __jsonErrorDetails) ? If( __jsonErrorDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmErrorInfo.FromJson(__p) )) ))() : null : ErrorDetail;} + {_virtualMachineVersion = If( json?.PropertyT("virtualMachineVersion"), out var __jsonVirtualMachineVersion) ? (string)__jsonVirtualMachineVersion : (string)VirtualMachineVersion;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobV2. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobV2. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmJobV2 FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmJobV2(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __job?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + if (null != this._actionsInfo) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._actionsInfo ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("actionsInfo",__w); + } + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)(null != this._duration ? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._duration)): null), "duration" ,container.Add ); + if (null != this._errorDetail) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._errorDetail ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("errorDetails",__r); + } + AddIf( null != (((object)this._virtualMachineVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._virtualMachineVersion.ToString()) : null, "virtualMachineVersion" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItem.cs new file mode 100644 index 000000000000..f7ffeacbc766 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItem.cs @@ -0,0 +1,448 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup item. + public partial class AzureIaaSvmProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int[] DiskExclusionPropertyDiskLunList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedPropertiesInternal)ExtendedProperty).DiskExclusionPropertyDiskLunList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedPropertiesInternal)ExtendedProperty).DiskExclusionPropertyDiskLunList = value ?? null /* arrayOf */; } + + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? DiskExclusionPropertyIsInclusionList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedPropertiesInternal)ExtendedProperty).DiskExclusionPropertyIsInclusionList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedPropertiesInternal)ExtendedProperty).DiskExclusionPropertyIsInclusionList = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfo _extendedInfo; + + /// Additional information for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectedItemExtendedInfo()); set => this._extendedInfo = value; } + + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).NewestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).NewestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPointInVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPointInVault = value ?? default(global::System.DateTime); } + + /// Specifies if backup policy associated with the backup item is inconsistent. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? ExtendedInfoPolicyInconsistent { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyInconsistent; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyInconsistent = value ?? default(bool); } + + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedProperties _extendedProperty; + + /// Extended Properties for Azure IaasVM Backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedProperties ExtendedProperty { get => (this._extendedProperty = this._extendedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ExtendedProperties()); set => this._extendedProperty = value; } + + /// Linux VM name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedPropertyLinuxVMApplicationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedPropertiesInternal)ExtendedProperty).LinuxVMApplicationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedPropertiesInternal)ExtendedProperty).LinuxVMApplicationName = value ?? null; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the VM represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails[] _healthDetail; + + /// Health details on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails[] HealthDetail { get => this._healthDetail; set => this._healthDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus? _healthStatus; + + /// Health status of protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus? HealthStatus { get => this._healthStatus; set => this._healthStatus = value; } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths _kpisHealth; + + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths KpisHealth { get => (this._kpisHealth = this._kpisHealth ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectedItemKpisHealths()); set => this._kpisHealth = value; } + + /// Backing field for property. + private string _lastBackupStatus; + + /// Last backup operation status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string LastBackupStatus { get => this._lastBackupStatus; set => this._lastBackupStatus = value; } + + /// Backing field for property. + private global::System.DateTime? _lastBackupTime; + + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? LastBackupTime { get => this._lastBackupTime; set => this._lastBackupTime = value; } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectedItemExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Internal Acessors for ExtendedProperty + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal.ExtendedProperty { get => (this._extendedProperty = this._extendedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ExtendedProperties()); set { {_extendedProperty = value;} } } + + /// Internal Acessors for ExtendedPropertyDiskExclusionProperty + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemInternal.ExtendedPropertyDiskExclusionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedPropertiesInternal)ExtendedProperty).DiskExclusionProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedPropertiesInternal)ExtendedProperty).DiskExclusionProperty = value; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName = value ?? null; } + + /// Backing field for property. + private string _protectedItemDataId; + + /// Data ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectedItemDataId { get => this._protectedItemDataId; set => this._protectedItemDataId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? _protectionState; + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get => this._protectionState; set => this._protectionState = value; } + + /// Backing field for property. + private string _protectionStatus; + + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectionStatus { get => this._protectionStatus; set => this._protectionStatus = value; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type = value ; } + + /// Backing field for property. + private string _virtualMachineId; + + /// Fully qualified ARM ID of the virtual machine represented by this item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VirtualMachineId { get => this._virtualMachineId; set => this._virtualMachineId = value; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public AzureIaaSvmProtectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectedItem), __protectedItem); + await eventListener.AssertObjectIsValid(nameof(__protectedItem), __protectedItem); + } + } + /// IaaS VM workload-specific backup item. + public partial interface IAzureIaaSvmProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem + { + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection.", + SerializedName = @"diskLunList", + PossibleTypes = new [] { typeof(int) })] + int[] DiskExclusionPropertyDiskLunList { get; set; } + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to indicate whether DiskLunList is to be included/ excluded from backup.", + SerializedName = @"isInclusionList", + PossibleTypes = new [] { typeof(bool) })] + bool? DiskExclusionPropertyIsInclusionList { get; set; } + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The latest backup copy available for this backup item in archive tier", + SerializedName = @"newestRecoveryPointInArchive", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item across all tiers.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item in archive tier", + SerializedName = @"oldestRecoveryPointInArchive", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item in vault tier", + SerializedName = @"oldestRecoveryPointInVault", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get; set; } + /// Specifies if backup policy associated with the backup item is inconsistent. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if backup policy associated with the backup item is inconsistent.", + SerializedName = @"policyInconsistent", + PossibleTypes = new [] { typeof(bool) })] + bool? ExtendedInfoPolicyInconsistent { get; set; } + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of backup copies available for this backup item.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoRecoveryPointCount { get; set; } + /// Linux VM name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Linux VM name", + SerializedName = @"linuxVmApplicationName", + PossibleTypes = new [] { typeof(string) })] + string ExtendedPropertyLinuxVMApplicationName { get; set; } + /// Friendly name of the VM represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the VM represented by this backup item.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Health details on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health details on this backup item.", + SerializedName = @"healthDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails[] HealthDetail { get; set; } + /// Health status of protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health status of protected item.", + SerializedName = @"healthStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus? HealthStatus { get; set; } + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health details of different KPIs", + SerializedName = @"kpisHealths", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths KpisHealth { get; set; } + /// Last backup operation status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last backup operation status.", + SerializedName = @"lastBackupStatus", + PossibleTypes = new [] { typeof(string) })] + string LastBackupStatus { get; set; } + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Timestamp of the last backup operation on this backup item.", + SerializedName = @"lastBackupTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastBackupTime { get; set; } + /// Data ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data ID of the protected item.", + SerializedName = @"protectedItemDataId", + PossibleTypes = new [] { typeof(string) })] + string ProtectedItemDataId { get; set; } + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup state of this backup item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get; set; } + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup status of this backup item.", + SerializedName = @"protectionStatus", + PossibleTypes = new [] { typeof(string) })] + string ProtectionStatus { get; set; } + /// Fully qualified ARM ID of the virtual machine represented by this item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM ID of the virtual machine represented by this item.", + SerializedName = @"virtualMachineId", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineId { get; set; } + + } + /// IaaS VM workload-specific backup item. + internal partial interface IAzureIaaSvmProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal + { + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + int[] DiskExclusionPropertyDiskLunList { get; set; } + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + bool? DiskExclusionPropertyIsInclusionList { get; set; } + /// Additional information for this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfo ExtendedInfo { get; set; } + /// The latest backup copy available for this backup item in archive tier + global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item across all tiers. + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// The oldest backup copy available for this backup item in archive tier + global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item in vault tier + global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get; set; } + /// Specifies if backup policy associated with the backup item is inconsistent. + bool? ExtendedInfoPolicyInconsistent { get; set; } + /// Number of backup copies available for this backup item. + int? ExtendedInfoRecoveryPointCount { get; set; } + /// Extended Properties for Azure IaasVM Backup. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedProperties ExtendedProperty { get; set; } + /// Extended Properties for Disk Exclusion. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties ExtendedPropertyDiskExclusionProperty { get; set; } + /// Linux VM name + string ExtendedPropertyLinuxVMApplicationName { get; set; } + /// Friendly name of the VM represented by this backup item. + string FriendlyName { get; set; } + /// Health details on this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails[] HealthDetail { get; set; } + /// Health status of protected item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus? HealthStatus { get; set; } + /// Health details of different KPIs + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths KpisHealth { get; set; } + /// Last backup operation status. + string LastBackupStatus { get; set; } + /// Timestamp of the last backup operation on this backup item. + global::System.DateTime? LastBackupTime { get; set; } + /// Data ID of the protected item. + string ProtectedItemDataId { get; set; } + /// Backup state of this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get; set; } + /// Backup status of this backup item. + string ProtectionStatus { get; set; } + /// Fully qualified ARM ID of the virtual machine represented by this item. + string VirtualMachineId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItem.json.cs new file mode 100644 index 000000000000..1e25e423db7f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItem.json.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup item. + public partial class AzureIaaSvmProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSvmProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectedItemExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_extendedProperty = If( json?.PropertyT("extendedProperties"), out var __jsonExtendedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ExtendedProperties.FromJson(__jsonExtendedProperties) : ExtendedProperty;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_virtualMachineId = If( json?.PropertyT("virtualMachineId"), out var __jsonVirtualMachineId) ? (string)__jsonVirtualMachineId : (string)VirtualMachineId;} + {_protectionStatus = If( json?.PropertyT("protectionStatus"), out var __jsonProtectionStatus) ? (string)__jsonProtectionStatus : (string)ProtectionStatus;} + {_protectionState = If( json?.PropertyT("protectionState"), out var __jsonProtectionState) ? (string)__jsonProtectionState : (string)ProtectionState;} + {_healthStatus = If( json?.PropertyT("healthStatus"), out var __jsonHealthStatus) ? (string)__jsonHealthStatus : (string)HealthStatus;} + {_healthDetail = If( json?.PropertyT("healthDetails"), out var __jsonHealthDetails) ? If( __jsonHealthDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceHealthDetails.FromJson(__u) )) ))() : null : HealthDetail;} + {_kpisHealth = If( json?.PropertyT("kpisHealths"), out var __jsonKpisHealths) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectedItemKpisHealths.FromJson(__jsonKpisHealths) : KpisHealth;} + {_lastBackupStatus = If( json?.PropertyT("lastBackupStatus"), out var __jsonLastBackupStatus) ? (string)__jsonLastBackupStatus : (string)LastBackupStatus;} + {_lastBackupTime = If( json?.PropertyT("lastBackupTime"), out var __jsonLastBackupTime) ? global::System.DateTime.TryParse((string)__jsonLastBackupTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastBackupTimeValue) ? __jsonLastBackupTimeValue : LastBackupTime : LastBackupTime;} + {_protectedItemDataId = If( json?.PropertyT("protectedItemDataId"), out var __jsonProtectedItemDataId) ? (string)__jsonProtectedItemDataId : (string)ProtectedItemDataId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItem interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("protectedItemType") ) + { + case "Microsoft.ClassicCompute/virtualMachines": + { + return new AzureIaaSClassicComputeVmprotectedItem(json); + } + case "Microsoft.Compute/virtualMachines": + { + return new AzureIaaSComputeVmprotectedItem(json); + } + } + return new AzureIaaSvmProtectedItem(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectedItem?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != this._extendedProperty ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedProperty.ToJson(null,serializationMode) : null, "extendedProperties" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._virtualMachineId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._virtualMachineId.ToString()) : null, "virtualMachineId" ,container.Add ); + AddIf( null != (((object)this._protectionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionStatus.ToString()) : null, "protectionStatus" ,container.Add ); + AddIf( null != (((object)this._protectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionState.ToString()) : null, "protectionState" ,container.Add ); + AddIf( null != (((object)this._healthStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._healthStatus.ToString()) : null, "healthStatus" ,container.Add ); + if (null != this._healthDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._healthDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("healthDetails",__w); + } + AddIf( null != this._kpisHealth ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._kpisHealth.ToJson(null,serializationMode) : null, "kpisHealths" ,container.Add ); + AddIf( null != (((object)this._lastBackupStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastBackupStatus.ToString()) : null, "lastBackupStatus" ,container.Add ); + AddIf( null != this._lastBackupTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastBackupTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastBackupTime" ,container.Add ); + AddIf( null != (((object)this._protectedItemDataId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectedItemDataId.ToString()) : null, "protectedItemDataId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..d3d0681876c7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on Azure IaaS VM specific backup item. + public partial class AzureIaaSvmProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfoInternal + { + + /// Backing field for property. + private global::System.DateTime? _newestRecoveryPointInArchive; + + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? NewestRecoveryPointInArchive { get => this._newestRecoveryPointInArchive; set => this._newestRecoveryPointInArchive = value; } + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPoint; + + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OldestRecoveryPoint { get => this._oldestRecoveryPoint; set => this._oldestRecoveryPoint = value; } + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPointInArchive; + + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OldestRecoveryPointInArchive { get => this._oldestRecoveryPointInArchive; set => this._oldestRecoveryPointInArchive = value; } + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPointInVault; + + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OldestRecoveryPointInVault { get => this._oldestRecoveryPointInVault; set => this._oldestRecoveryPointInVault = value; } + + /// Backing field for property. + private bool? _policyInconsistent; + + /// Specifies if backup policy associated with the backup item is inconsistent. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? PolicyInconsistent { get => this._policyInconsistent; set => this._policyInconsistent = value; } + + /// Backing field for property. + private int? _recoveryPointCount; + + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? RecoveryPointCount { get => this._recoveryPointCount; set => this._recoveryPointCount = value; } + + /// Creates an new instance. + public AzureIaaSvmProtectedItemExtendedInfo() + { + + } + } + /// Additional information on Azure IaaS VM specific backup item. + public partial interface IAzureIaaSvmProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The latest backup copy available for this backup item in archive tier", + SerializedName = @"newestRecoveryPointInArchive", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? NewestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item across all tiers.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item in archive tier", + SerializedName = @"oldestRecoveryPointInArchive", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item in vault tier", + SerializedName = @"oldestRecoveryPointInVault", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPointInVault { get; set; } + /// Specifies if backup policy associated with the backup item is inconsistent. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if backup policy associated with the backup item is inconsistent.", + SerializedName = @"policyInconsistent", + PossibleTypes = new [] { typeof(bool) })] + bool? PolicyInconsistent { get; set; } + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of backup copies available for this backup item.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? RecoveryPointCount { get; set; } + + } + /// Additional information on Azure IaaS VM specific backup item. + internal partial interface IAzureIaaSvmProtectedItemExtendedInfoInternal + + { + /// The latest backup copy available for this backup item in archive tier + global::System.DateTime? NewestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item across all tiers. + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// The oldest backup copy available for this backup item in archive tier + global::System.DateTime? OldestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item in vault tier + global::System.DateTime? OldestRecoveryPointInVault { get; set; } + /// Specifies if backup policy associated with the backup item is inconsistent. + bool? PolicyInconsistent { get; set; } + /// Number of backup copies available for this backup item. + int? RecoveryPointCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..f18802b90763 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on Azure IaaS VM specific backup item. + public partial class AzureIaaSvmProtectedItemExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSvmProtectedItemExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_oldestRecoveryPoint = If( json?.PropertyT("oldestRecoveryPoint"), out var __jsonOldestRecoveryPoint) ? global::System.DateTime.TryParse((string)__jsonOldestRecoveryPoint, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOldestRecoveryPointValue) ? __jsonOldestRecoveryPointValue : OldestRecoveryPoint : OldestRecoveryPoint;} + {_oldestRecoveryPointInVault = If( json?.PropertyT("oldestRecoveryPointInVault"), out var __jsonOldestRecoveryPointInVault) ? global::System.DateTime.TryParse((string)__jsonOldestRecoveryPointInVault, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOldestRecoveryPointInVaultValue) ? __jsonOldestRecoveryPointInVaultValue : OldestRecoveryPointInVault : OldestRecoveryPointInVault;} + {_oldestRecoveryPointInArchive = If( json?.PropertyT("oldestRecoveryPointInArchive"), out var __jsonOldestRecoveryPointInArchive) ? global::System.DateTime.TryParse((string)__jsonOldestRecoveryPointInArchive, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOldestRecoveryPointInArchiveValue) ? __jsonOldestRecoveryPointInArchiveValue : OldestRecoveryPointInArchive : OldestRecoveryPointInArchive;} + {_newestRecoveryPointInArchive = If( json?.PropertyT("newestRecoveryPointInArchive"), out var __jsonNewestRecoveryPointInArchive) ? global::System.DateTime.TryParse((string)__jsonNewestRecoveryPointInArchive, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonNewestRecoveryPointInArchiveValue) ? __jsonNewestRecoveryPointInArchiveValue : NewestRecoveryPointInArchive : NewestRecoveryPointInArchive;} + {_recoveryPointCount = If( json?.PropertyT("recoveryPointCount"), out var __jsonRecoveryPointCount) ? (int?)__jsonRecoveryPointCount : RecoveryPointCount;} + {_policyInconsistent = If( json?.PropertyT("policyInconsistent"), out var __jsonPolicyInconsistent) ? (bool?)__jsonPolicyInconsistent : PolicyInconsistent;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmProtectedItemExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._oldestRecoveryPoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oldestRecoveryPoint?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "oldestRecoveryPoint" ,container.Add ); + AddIf( null != this._oldestRecoveryPointInVault ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oldestRecoveryPointInVault?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "oldestRecoveryPointInVault" ,container.Add ); + AddIf( null != this._oldestRecoveryPointInArchive ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oldestRecoveryPointInArchive?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "oldestRecoveryPointInArchive" ,container.Add ); + AddIf( null != this._newestRecoveryPointInArchive ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._newestRecoveryPointInArchive?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "newestRecoveryPointInArchive" ,container.Add ); + AddIf( null != this._recoveryPointCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._recoveryPointCount) : null, "recoveryPointCount" ,container.Add ); + AddIf( null != this._policyInconsistent ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._policyInconsistent) : null, "policyInconsistent" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.cs new file mode 100644 index 000000000000..8c9a0d33623c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health details of different KPIs + public partial class AzureIaaSvmProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealthsInternal + { + + /// Creates an new instance. + public AzureIaaSvmProtectedItemKpisHealths() + { + + } + } + /// Health details of different KPIs + public partial interface IAzureIaaSvmProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Health details of different KPIs + internal partial interface IAzureIaaSvmProtectedItemKpisHealthsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.dictionary.cs new file mode 100644 index 000000000000..734e9b073fb5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AzureIaaSvmProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectedItemKpisHealths source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.json.cs new file mode 100644 index 000000000000..f1ae47e846d8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectedItemKpisHealths.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health details of different KPIs + public partial class AzureIaaSvmProtectedItemKpisHealths + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureIaaSvmProtectedItemKpisHealths(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.KpiResourceHealthDetails.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectedItemKpisHealths FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmProtectedItemKpisHealths(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicy.cs new file mode 100644 index 000000000000..56ef72be09b0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicy.cs @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup policy. + public partial class AzureIaaSvmProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetails _instantRpDetail; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetails InstantRpDetail { get => (this._instantRpDetail = this._instantRpDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InstantRpAdditionalDetails()); set => this._instantRpDetail = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string InstantRpDetailAzureBackupRgNamePrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetailsInternal)InstantRpDetail).AzureBackupRgNamePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetailsInternal)InstantRpDetail).AzureBackupRgNamePrefix = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string InstantRpDetailAzureBackupRgNameSuffix { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetailsInternal)InstantRpDetail).AzureBackupRgNameSuffix; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetailsInternal)InstantRpDetail).AzureBackupRgNameSuffix = value ?? null; } + + /// Backing field for property. + private int? _instantRpRetentionRangeInDay; + + /// Instant RP retention policy range in days + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? InstantRpRetentionRangeInDay { get => this._instantRpRetentionRangeInDay; set => this._instantRpRetentionRangeInDay = value; } + + /// Internal Acessors for InstantRpDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyInternal.InstantRpDetail { get => (this._instantRpDetail = this._instantRpDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InstantRpAdditionalDetails()); set { {_instantRpDetail = value;} } } + + /// Internal Acessors for RetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyInternal.RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy()); set { {_retentionPolicy = value;} } } + + /// Internal Acessors for SchedulePolicy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyInternal.SchedulePolicy { get => (this._schedulePolicy = this._schedulePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy()); set { {_schedulePolicy = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType? _policyType; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType? PolicyType { get => this._policyType; set => this._policyType = value; } + + /// Number of items associated with this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount = value ?? default(int); } + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy _retentionPolicy; + + /// Retention policy with the details on backup copy retention ranges. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy()); set => this._retentionPolicy = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RetentionPolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)RetentionPolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)RetentionPolicy).Type = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy _schedulePolicy; + + /// Backup schedule specified as part of backup policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy SchedulePolicy { get => (this._schedulePolicy = this._schedulePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy()); set => this._schedulePolicy = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string SchedulePolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)SchedulePolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)SchedulePolicy).Type = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyTieringPolicy _tieringPolicy; + + /// + /// Tiering policy to automatically move RPs to another tier + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyTieringPolicy TieringPolicy { get => (this._tieringPolicy = this._tieringPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectionPolicyTieringPolicy()); set => this._tieringPolicy = value; } + + /// Backing field for property. + private string _timeZone; + + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TimeZone { get => this._timeZone; set => this._timeZone = value; } + + /// Creates an new instance. + public AzureIaaSvmProtectionPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionPolicy), __protectionPolicy); + await eventListener.AssertObjectIsValid(nameof(__protectionPolicy), __protectionPolicy); + } + } + /// IaaS VM workload-specific backup policy. + public partial interface IAzureIaaSvmProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"azureBackupRGNamePrefix", + PossibleTypes = new [] { typeof(string) })] + string InstantRpDetailAzureBackupRgNamePrefix { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"azureBackupRGNameSuffix", + PossibleTypes = new [] { typeof(string) })] + string InstantRpDetailAzureBackupRgNameSuffix { get; set; } + /// Instant RP retention policy range in days + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Instant RP retention policy range in days", + SerializedName = @"instantRpRetentionRangeInDays", + PossibleTypes = new [] { typeof(int) })] + int? InstantRpRetentionRangeInDay { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"policyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType? PolicyType { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"retentionPolicyType", + PossibleTypes = new [] { typeof(string) })] + string RetentionPolicyType { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"schedulePolicyType", + PossibleTypes = new [] { typeof(string) })] + string SchedulePolicyType { get; set; } + /// + /// Tiering policy to automatically move RPs to another tier + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tiering policy to automatically move RPs to another tier + Key is Target Tier, defined in RecoveryPointTierType enum. + Tiering policy specifies the criteria to move RP to the target tier.", + SerializedName = @"tieringPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyTieringPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyTieringPolicy TieringPolicy { get; set; } + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"TimeZone optional input as string. For example: TimeZone = ""Pacific Standard Time"".", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string TimeZone { get; set; } + + } + /// IaaS VM workload-specific backup policy. + internal partial interface IAzureIaaSvmProtectionPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetails InstantRpDetail { get; set; } + + string InstantRpDetailAzureBackupRgNamePrefix { get; set; } + + string InstantRpDetailAzureBackupRgNameSuffix { get; set; } + /// Instant RP retention policy range in days + int? InstantRpRetentionRangeInDay { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType? PolicyType { get; set; } + /// Retention policy with the details on backup copy retention ranges. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy RetentionPolicy { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string RetentionPolicyType { get; set; } + /// Backup schedule specified as part of backup policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy SchedulePolicy { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string SchedulePolicyType { get; set; } + /// + /// Tiering policy to automatically move RPs to another tier + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyTieringPolicy TieringPolicy { get; set; } + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + string TimeZone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicy.json.cs new file mode 100644 index 000000000000..d306fd11eef7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup policy. + public partial class AzureIaaSvmProtectionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureIaaSvmProtectionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(json); + {_instantRpDetail = If( json?.PropertyT("instantRPDetails"), out var __jsonInstantRpDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InstantRpAdditionalDetails.FromJson(__jsonInstantRpDetails) : InstantRpDetail;} + {_schedulePolicy = If( json?.PropertyT("schedulePolicy"), out var __jsonSchedulePolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy.FromJson(__jsonSchedulePolicy) : SchedulePolicy;} + {_retentionPolicy = If( json?.PropertyT("retentionPolicy"), out var __jsonRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy.FromJson(__jsonRetentionPolicy) : RetentionPolicy;} + {_tieringPolicy = If( json?.PropertyT("tieringPolicy"), out var __jsonTieringPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectionPolicyTieringPolicy.FromJson(__jsonTieringPolicy) : TieringPolicy;} + {_instantRpRetentionRangeInDay = If( json?.PropertyT("instantRpRetentionRangeInDays"), out var __jsonInstantRpRetentionRangeInDays) ? (int?)__jsonInstantRpRetentionRangeInDays : InstantRpRetentionRangeInDay;} + {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)TimeZone;} + {_policyType = If( json?.PropertyT("policyType"), out var __jsonPolicyType) ? (string)__jsonPolicyType : (string)PolicyType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmProtectionPolicy(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionPolicy?.ToJson(container, serializationMode); + AddIf( null != this._instantRpDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._instantRpDetail.ToJson(null,serializationMode) : null, "instantRPDetails" ,container.Add ); + AddIf( null != this._schedulePolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._schedulePolicy.ToJson(null,serializationMode) : null, "schedulePolicy" ,container.Add ); + AddIf( null != this._retentionPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionPolicy.ToJson(null,serializationMode) : null, "retentionPolicy" ,container.Add ); + AddIf( null != this._tieringPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._tieringPolicy.ToJson(null,serializationMode) : null, "tieringPolicy" ,container.Add ); + AddIf( null != this._instantRpRetentionRangeInDay ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._instantRpRetentionRangeInDay) : null, "instantRpRetentionRangeInDays" ,container.Add ); + AddIf( null != (((object)this._timeZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._timeZone.ToString()) : null, "timeZone" ,container.Add ); + AddIf( null != (((object)this._policyType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyType.ToString()) : null, "policyType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.cs new file mode 100644 index 000000000000..fcd23431b62f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Tiering policy to automatically move RPs to another tier + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + /// + public partial class AzureIaaSvmProtectionPolicyTieringPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyTieringPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyTieringPolicyInternal + { + + /// + /// Creates an new instance. + /// + public AzureIaaSvmProtectionPolicyTieringPolicy() + { + + } + } + /// Tiering policy to automatically move RPs to another tier + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + public partial interface IAzureIaaSvmProtectionPolicyTieringPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Tiering policy to automatically move RPs to another tier + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + internal partial interface IAzureIaaSvmProtectionPolicyTieringPolicyInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.dictionary.cs new file mode 100644 index 000000000000..ca35fbbdf7b1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AzureIaaSvmProtectionPolicyTieringPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicy this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicy value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicy value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureIaaSvmProtectionPolicyTieringPolicy source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.json.cs new file mode 100644 index 000000000000..5e7ff032c35c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureIaaSvmProtectionPolicyTieringPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Tiering policy to automatically move RPs to another tier + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + /// + public partial class AzureIaaSvmProtectionPolicyTieringPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureIaaSvmProtectionPolicyTieringPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.TieringPolicy.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyTieringPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyTieringPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureIaaSvmProtectionPolicyTieringPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureIaaSvmProtectionPolicyTieringPolicy(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureRecoveryServiceVaultProtectionIntent.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureRecoveryServiceVaultProtectionIntent.cs new file mode 100644 index 000000000000..f152f612e7ee --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureRecoveryServiceVaultProtectionIntent.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Recovery Services Vault specific protection intent item. + public partial class AzureRecoveryServiceVaultProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureRecoveryServiceVaultProtectionIntent, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureRecoveryServiceVaultProtectionIntentInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent __protectionIntent = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ItemId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemId = value ?? null; } + + /// backup protectionIntent type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType ItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemType = value ; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).PolicyId = value ?? null; } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).SourceResourceId = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureRecoveryServiceVaultProtectionIntent() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionIntent), __protectionIntent); + await eventListener.AssertObjectIsValid(nameof(__protectionIntent), __protectionIntent); + } + } + /// Azure Recovery Services Vault specific protection intent item. + public partial interface IAzureRecoveryServiceVaultProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent + { + + } + /// Azure Recovery Services Vault specific protection intent item. + internal partial interface IAzureRecoveryServiceVaultProtectionIntentInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureRecoveryServiceVaultProtectionIntent.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureRecoveryServiceVaultProtectionIntent.json.cs new file mode 100644 index 000000000000..e5056d47a6cf --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureRecoveryServiceVaultProtectionIntent.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Recovery Services Vault specific protection intent item. + public partial class AzureRecoveryServiceVaultProtectionIntent + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureRecoveryServiceVaultProtectionIntent(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionIntent = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureRecoveryServiceVaultProtectionIntent. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureRecoveryServiceVaultProtectionIntent + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureRecoveryServiceVaultProtectionIntent. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureRecoveryServiceVaultProtectionIntent FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("protectionIntentItemType") ) + { + case "AzureWorkloadSQLAutoProtectionIntent": + { + return new AzureWorkloadSqlAutoProtectionIntent(json); + } + } + return new AzureRecoveryServiceVaultProtectionIntent(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionIntent?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureResourceProtectionIntent.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureResourceProtectionIntent.cs new file mode 100644 index 000000000000..fb0162c5438a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureResourceProtectionIntent.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM specific backup protection intent item. + public partial class AzureResourceProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureResourceProtectionIntent, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureResourceProtectionIntentInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent __protectionIntent = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the VM represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ItemId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemId = value ?? null; } + + /// backup protectionIntent type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType ItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemType = value ; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).PolicyId = value ?? null; } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).SourceResourceId = value ?? null; } + + /// Creates an new instance. + public AzureResourceProtectionIntent() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionIntent), __protectionIntent); + await eventListener.AssertObjectIsValid(nameof(__protectionIntent), __protectionIntent); + } + } + /// IaaS VM specific backup protection intent item. + public partial interface IAzureResourceProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent + { + /// Friendly name of the VM represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the VM represented by this backup item.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + + } + /// IaaS VM specific backup protection intent item. + internal partial interface IAzureResourceProtectionIntentInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal + { + /// Friendly name of the VM represented by this backup item. + string FriendlyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureResourceProtectionIntent.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureResourceProtectionIntent.json.cs new file mode 100644 index 000000000000..8305ed4aa8c5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureResourceProtectionIntent.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM specific backup protection intent item. + public partial class AzureResourceProtectionIntent + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureResourceProtectionIntent(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionIntent = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent(json); + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureResourceProtectionIntent. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureResourceProtectionIntent. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureResourceProtectionIntent FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureResourceProtectionIntent(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionIntent?.ToJson(container, serializationMode); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlContainer.cs new file mode 100644 index 000000000000..bbc0692a1f4b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlContainer.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Sql workload-specific container. + public partial class AzureSqlContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType = value ; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus = value ?? null; } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType = value ?? null; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus = value ?? null; } + + /// Creates an new instance. + public AzureSqlContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionContainer), __protectionContainer); + await eventListener.AssertObjectIsValid(nameof(__protectionContainer), __protectionContainer); + } + } + /// Azure Sql workload-specific container. + public partial interface IAzureSqlContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer + { + + } + /// Azure Sql workload-specific container. + internal partial interface IAzureSqlContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlContainer.json.cs new file mode 100644 index 000000000000..c27e86e2fa1d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Sql workload-specific container. + public partial class AzureSqlContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureSqlContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureSqlContainer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionContainer?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItem.cs new file mode 100644 index 000000000000..e4dc1110bb1d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItem.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure SQL workload-specific backup item. + public partial class AzureSqlProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfo _extendedInfo; + + /// Additional information for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureSqlProtectedItemExtendedInfo()); set => this._extendedInfo = value; } + + /// The oldest backup copy available for this item in the service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// State of the backup policy associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyState = value ?? null; } + + /// Number of available backup copies associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount = value ?? default(int); } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureSqlProtectedItemExtendedInfo()); set { {_extendedInfo = value;} } } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName = value ?? null; } + + /// Backing field for property. + private string _protectedItemDataId; + + /// + /// Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectedItemDataId { get => this._protectedItemDataId; set => this._protectedItemDataId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState? _protectionState; + + /// Backup state of the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState? ProtectionState { get => this._protectionState; set => this._protectionState = value; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type = value ; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public AzureSqlProtectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectedItem), __protectedItem); + await eventListener.AssertObjectIsValid(nameof(__protectedItem), __protectedItem); + } + } + /// Azure SQL workload-specific backup item. + public partial interface IAzureSqlProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem + { + /// The oldest backup copy available for this item in the service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this item in the service.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// State of the backup policy associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"State of the backup policy associated with this backup item.", + SerializedName = @"policyState", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoPolicyState { get; set; } + /// Number of available backup copies associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of available backup copies associated with this backup item.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoRecoveryPointCount { get; set; } + /// + /// Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services.", + SerializedName = @"protectedItemDataId", + PossibleTypes = new [] { typeof(string) })] + string ProtectedItemDataId { get; set; } + /// Backup state of the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup state of the backed up item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState? ProtectionState { get; set; } + + } + /// Azure SQL workload-specific backup item. + internal partial interface IAzureSqlProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal + { + /// Additional information for this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfo ExtendedInfo { get; set; } + /// The oldest backup copy available for this item in the service. + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// State of the backup policy associated with this backup item. + string ExtendedInfoPolicyState { get; set; } + /// Number of available backup copies associated with this backup item. + int? ExtendedInfoRecoveryPointCount { get; set; } + /// + /// Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + /// + string ProtectedItemDataId { get; set; } + /// Backup state of the backed up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState? ProtectionState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItem.json.cs new file mode 100644 index 000000000000..567df2e1a401 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure SQL workload-specific backup item. + public partial class AzureSqlProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureSqlProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureSqlProtectedItemExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_protectedItemDataId = If( json?.PropertyT("protectedItemDataId"), out var __jsonProtectedItemDataId) ? (string)__jsonProtectedItemDataId : (string)ProtectedItemDataId;} + {_protectionState = If( json?.PropertyT("protectionState"), out var __jsonProtectionState) ? (string)__jsonProtectionState : (string)ProtectionState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureSqlProtectedItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectedItem?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != (((object)this._protectedItemDataId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectedItemDataId.ToString()) : null, "protectedItemDataId" ,container.Add ); + AddIf( null != (((object)this._protectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionState.ToString()) : null, "protectionState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..41dcade57a2d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItemExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on Azure Sql specific protected item. + public partial class AzureSqlProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfoInternal + { + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPoint; + + /// The oldest backup copy available for this item in the service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OldestRecoveryPoint { get => this._oldestRecoveryPoint; set => this._oldestRecoveryPoint = value; } + + /// Backing field for property. + private string _policyState; + + /// State of the backup policy associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyState { get => this._policyState; set => this._policyState = value; } + + /// Backing field for property. + private int? _recoveryPointCount; + + /// Number of available backup copies associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? RecoveryPointCount { get => this._recoveryPointCount; set => this._recoveryPointCount = value; } + + /// Creates an new instance. + public AzureSqlProtectedItemExtendedInfo() + { + + } + } + /// Additional information on Azure Sql specific protected item. + public partial interface IAzureSqlProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The oldest backup copy available for this item in the service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this item in the service.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// State of the backup policy associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"State of the backup policy associated with this backup item.", + SerializedName = @"policyState", + PossibleTypes = new [] { typeof(string) })] + string PolicyState { get; set; } + /// Number of available backup copies associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of available backup copies associated with this backup item.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? RecoveryPointCount { get; set; } + + } + /// Additional information on Azure Sql specific protected item. + internal partial interface IAzureSqlProtectedItemExtendedInfoInternal + + { + /// The oldest backup copy available for this item in the service. + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// State of the backup policy associated with this backup item. + string PolicyState { get; set; } + /// Number of available backup copies associated with this backup item. + int? RecoveryPointCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..cd1fe5ebdcdf --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectedItemExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on Azure Sql specific protected item. + public partial class AzureSqlProtectedItemExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureSqlProtectedItemExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_oldestRecoveryPoint = If( json?.PropertyT("oldestRecoveryPoint"), out var __jsonOldestRecoveryPoint) ? global::System.DateTime.TryParse((string)__jsonOldestRecoveryPoint, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOldestRecoveryPointValue) ? __jsonOldestRecoveryPointValue : OldestRecoveryPoint : OldestRecoveryPoint;} + {_recoveryPointCount = If( json?.PropertyT("recoveryPointCount"), out var __jsonRecoveryPointCount) ? (int?)__jsonRecoveryPointCount : RecoveryPointCount;} + {_policyState = If( json?.PropertyT("policyState"), out var __jsonPolicyState) ? (string)__jsonPolicyState : (string)PolicyState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectedItemExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureSqlProtectedItemExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._oldestRecoveryPoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oldestRecoveryPoint?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "oldestRecoveryPoint" ,container.Add ); + AddIf( null != this._recoveryPointCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._recoveryPointCount) : null, "recoveryPointCount" ,container.Add ); + AddIf( null != (((object)this._policyState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyState.ToString()) : null, "policyState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectionPolicy.cs new file mode 100644 index 000000000000..ccbdd81467cc --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectionPolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure SQL workload-specific backup policy. + public partial class AzureSqlProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectionPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType = value ; } + + /// Internal Acessors for RetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectionPolicyInternal.RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy()); set { {_retentionPolicy = value;} } } + + /// Number of items associated with this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount = value ?? default(int); } + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy _retentionPolicy; + + /// Retention policy details. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy()); set => this._retentionPolicy = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RetentionPolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)RetentionPolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)RetentionPolicy).Type = value ?? null; } + + /// Creates an new instance. + public AzureSqlProtectionPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionPolicy), __protectionPolicy); + await eventListener.AssertObjectIsValid(nameof(__protectionPolicy), __protectionPolicy); + } + } + /// Azure SQL workload-specific backup policy. + public partial interface IAzureSqlProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"retentionPolicyType", + PossibleTypes = new [] { typeof(string) })] + string RetentionPolicyType { get; set; } + + } + /// Azure SQL workload-specific backup policy. + internal partial interface IAzureSqlProtectionPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal + { + /// Retention policy details. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy RetentionPolicy { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string RetentionPolicyType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectionPolicy.json.cs new file mode 100644 index 000000000000..5c2b3a970b7e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlProtectionPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure SQL workload-specific backup policy. + public partial class AzureSqlProtectionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureSqlProtectionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(json); + {_retentionPolicy = If( json?.PropertyT("retentionPolicy"), out var __jsonRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy.FromJson(__jsonRetentionPolicy) : RetentionPolicy;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlProtectionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureSqlProtectionPolicy(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionPolicy?.ToJson(container, serializationMode); + AddIf( null != this._retentionPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionPolicy.ToJson(null,serializationMode) : null, "retentionPolicy" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlagWorkloadContainerProtectionContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlagWorkloadContainerProtectionContainer.cs new file mode 100644 index 000000000000..8e21ee574a1f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlagWorkloadContainerProtectionContainer.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container for SQL workloads under SQL Availability Group. + public partial class AzureSqlagWorkloadContainerProtectionContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlagWorkloadContainerProtectionContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlagWorkloadContainerProtectionContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainer __azureWorkloadContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).ContainerType = value ; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailCode; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailMessage; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailRecommendation; } + + /// Additional details of a workload container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfo = value ?? null /* model class */; } + + /// + /// Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedInfoHostServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoHostServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoHostServerName = value ?? null; } + + /// Inquiry Status for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo ExtendedInfoInquiryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoInquiryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoInquiryInfo = value ?? null /* model class */; } + + /// List of the nodes in case of distributed container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo[] ExtendedInfoNodesList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoNodesList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoNodesList = value ?? null /* arrayOf */; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).HealthStatus = value ?? null; } + + /// Error Details if the Status is non-success. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail InquiryInfoErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoErrorDetail = value ?? null /* model class */; } + + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryInfoInquiryDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoInquiryDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoInquiryDetail = value ?? null /* arrayOf */; } + + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string InquiryInfoStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoStatus = value ?? null; } + + /// Time stamp when this container was updated. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastUpdatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).LastUpdatedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).LastUpdatedTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailCode = value; } + + /// Internal Acessors for ErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailMessage = value; } + + /// Internal Acessors for ErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailRecommendation = value; } + + /// Re-Do Operation + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType? OperationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).OperationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).OperationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType)""); } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).ProtectableObjectType = value ?? null; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).RegistrationStatus = value ?? null; } + + /// ARM ID of the virtual machine represented by this Azure Workload Container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).SourceResourceId = value ?? null; } + + /// Workload type for which registration was sent. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType)""); } + + /// + /// Creates an new instance. + /// + public AzureSqlagWorkloadContainerProtectionContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadContainer), __azureWorkloadContainer); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadContainer), __azureWorkloadContainer); + } + } + /// Container for SQL workloads under SQL Availability Group. + public partial interface IAzureSqlagWorkloadContainerProtectionContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainer + { + + } + /// Container for SQL workloads under SQL Availability Group. + internal partial interface IAzureSqlagWorkloadContainerProtectionContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlagWorkloadContainerProtectionContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlagWorkloadContainerProtectionContainer.json.cs new file mode 100644 index 000000000000..0721f4db2617 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureSqlagWorkloadContainerProtectionContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container for SQL workloads under SQL Availability Group. + public partial class AzureSqlagWorkloadContainerProtectionContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureSqlagWorkloadContainerProtectionContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadContainer(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlagWorkloadContainerProtectionContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlagWorkloadContainerProtectionContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureSqlagWorkloadContainerProtectionContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureSqlagWorkloadContainerProtectionContainer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadContainer?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageContainer.cs new file mode 100644 index 000000000000..102917b2a4ec --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageContainer.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Storage Account workload-specific container. + public partial class AzureStorageContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock? _acquireStorageAccountLock; + + /// Whether storage account lock is to be acquired for this container or not. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock? AcquireStorageAccountLock { get => this._acquireStorageAccountLock; set => this._acquireStorageAccountLock = value; } + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType = value ; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus = value ?? null; } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType = value ?? null; } + + /// Backing field for property. + private long? _protectedItemCount; + + /// Number of items backed up in this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? ProtectedItemCount { get => this._protectedItemCount; set => this._protectedItemCount = value; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus = value ?? null; } + + /// Backing field for property. + private string _resourceGroup; + + /// Resource group name of Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceGroup { get => this._resourceGroup; set => this._resourceGroup = value; } + + /// Backing field for property. + private string _sourceResourceId; + + /// Fully qualified ARM url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Backing field for property. + private string _storageAccountVersion; + + /// Storage account version. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string StorageAccountVersion { get => this._storageAccountVersion; set => this._storageAccountVersion = value; } + + /// Creates an new instance. + public AzureStorageContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionContainer), __protectionContainer); + await eventListener.AssertObjectIsValid(nameof(__protectionContainer), __protectionContainer); + } + } + /// Azure Storage Account workload-specific container. + public partial interface IAzureStorageContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer + { + /// Whether storage account lock is to be acquired for this container or not. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether storage account lock is to be acquired for this container or not.", + SerializedName = @"acquireStorageAccountLock", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock? AcquireStorageAccountLock { get; set; } + /// Number of items backed up in this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of items backed up in this container.", + SerializedName = @"protectedItemCount", + PossibleTypes = new [] { typeof(long) })] + long? ProtectedItemCount { get; set; } + /// Resource group name of Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource group name of Recovery Services Vault.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; set; } + /// Fully qualified ARM url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM url.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + /// Storage account version. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage account version.", + SerializedName = @"storageAccountVersion", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountVersion { get; set; } + + } + /// Azure Storage Account workload-specific container. + internal partial interface IAzureStorageContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal + { + /// Whether storage account lock is to be acquired for this container or not. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock? AcquireStorageAccountLock { get; set; } + /// Number of items backed up in this container. + long? ProtectedItemCount { get; set; } + /// Resource group name of Recovery Services Vault. + string ResourceGroup { get; set; } + /// Fully qualified ARM url. + string SourceResourceId { get; set; } + /// Storage account version. + string StorageAccountVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageContainer.json.cs new file mode 100644 index 000000000000..e8904451e60f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Storage Account workload-specific container. + public partial class AzureStorageContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureStorageContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(json); + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + {_storageAccountVersion = If( json?.PropertyT("storageAccountVersion"), out var __jsonStorageAccountVersion) ? (string)__jsonStorageAccountVersion : (string)StorageAccountVersion;} + {_resourceGroup = If( json?.PropertyT("resourceGroup"), out var __jsonResourceGroup) ? (string)__jsonResourceGroup : (string)ResourceGroup;} + {_protectedItemCount = If( json?.PropertyT("protectedItemCount"), out var __jsonProtectedItemCount) ? (long?)__jsonProtectedItemCount : ProtectedItemCount;} + {_acquireStorageAccountLock = If( json?.PropertyT("acquireStorageAccountLock"), out var __jsonAcquireStorageAccountLock) ? (string)__jsonAcquireStorageAccountLock : (string)AcquireStorageAccountLock;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureStorageContainer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionContainer?.ToJson(container, serializationMode); + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + AddIf( null != (((object)this._storageAccountVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._storageAccountVersion.ToString()) : null, "storageAccountVersion" ,container.Add ); + AddIf( null != (((object)this._resourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceGroup.ToString()) : null, "resourceGroup" ,container.Add ); + AddIf( null != this._protectedItemCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._protectedItemCount) : null, "protectedItemCount" ,container.Add ); + AddIf( null != (((object)this._acquireStorageAccountLock)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._acquireStorageAccountLock.ToString()) : null, "acquireStorageAccountLock" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageErrorInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageErrorInfo.cs new file mode 100644 index 000000000000..48015f5b69d1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageErrorInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific error information + public partial class AzureStorageErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfoInternal + { + + /// Backing field for property. + private int? _errorCode; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? ErrorCode { get => this._errorCode; set => this._errorCode = value; } + + /// Backing field for property. + private string _errorString; + + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorString { get => this._errorString; set => this._errorString = value; } + + /// Backing field for property. + private string[] _recommendation; + + /// List of localized recommendations for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; set => this._recommendation = value; } + + /// Creates an new instance. + public AzureStorageErrorInfo() + { + + } + } + /// Azure storage specific error information + public partial interface IAzureStorageErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(int) })] + int? ErrorCode { get; set; } + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Localized error string.", + SerializedName = @"errorString", + PossibleTypes = new [] { typeof(string) })] + string ErrorString { get; set; } + /// List of localized recommendations for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of localized recommendations for above error code.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; set; } + + } + /// Azure storage specific error information + internal partial interface IAzureStorageErrorInfoInternal + + { + /// Error code. + int? ErrorCode { get; set; } + /// Localized error string. + string ErrorString { get; set; } + /// List of localized recommendations for above error code. + string[] Recommendation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageErrorInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageErrorInfo.json.cs new file mode 100644 index 000000000000..ad904a9c00b8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageErrorInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific error information + public partial class AzureStorageErrorInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureStorageErrorInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (int?)__jsonErrorCode : ErrorCode;} + {_errorString = If( json?.PropertyT("errorString"), out var __jsonErrorString) ? (string)__jsonErrorString : (string)ErrorString;} + {_recommendation = If( json?.PropertyT("recommendations"), out var __jsonRecommendations) ? If( __jsonRecommendations as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Recommendation;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureStorageErrorInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._errorCode ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._errorCode) : null, "errorCode" ,container.Add ); + AddIf( null != (((object)this._errorString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorString.ToString()) : null, "errorString" ,container.Add ); + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJob.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJob.cs new file mode 100644 index 000000000000..303a0f43c65d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJob.cs @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific job. + public partial class AzureStorageJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] _actionsInfo; + + /// Gets or sets the state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get => this._actionsInfo; set => this._actionsInfo = value; } + + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ActivityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId = value ?? null; } + + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Backing field for property. + private global::System.TimeSpan? _duration; + + /// Time elapsed during the execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.TimeSpan? Duration { get => this._duration; set => this._duration = value; } + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? EndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime = value ?? default(global::System.DateTime); } + + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EntityFriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfo[] _errorDetail; + + /// Error details on execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfo _extendedInfo; + + /// Additional information about the job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureStorageJobExtendedInfo()); set => this._extendedInfo = value; } + + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoDynamicErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage = value ?? null; } + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoInternal)ExtendedInfo).PropertyBag = value ?? null /* model class */; } + + /// List of tasks for this job + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoInternal)ExtendedInfo).TasksList = value ?? null /* arrayOf */; } + + /// Backing field for property. + private bool? _isUserTriggered; + + /// Indicated that whether the job is adhoc(true) or scheduled(false) + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsUserTriggered { get => this._isUserTriggered; set => this._isUserTriggered = value; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureStorageJobExtendedInfo()); set { {_extendedInfo = value;} } } + + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Operation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation = value ?? null; } + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime = value ?? default(global::System.DateTime); } + + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status = value ?? null; } + + /// Backing field for property. + private string _storageAccountName; + + /// Specifies friendly name of the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string StorageAccountName { get => this._storageAccountName; set => this._storageAccountName = value; } + + /// Backing field for property. + private string _storageAccountVersion; + + /// + /// Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string StorageAccountVersion { get => this._storageAccountVersion; set => this._storageAccountVersion = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type = value ; } + + /// Creates an new instance. + public AzureStorageJob() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__job), __job); + await eventListener.AssertObjectIsValid(nameof(__job), __job); + } + } + /// Azure storage specific job. + public partial interface IAzureStorageJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob + { + /// Gets or sets the state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the state/actions applicable on this job like cancel/retry.", + SerializedName = @"actionsInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Time elapsed during the execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time elapsed during the execution of this job.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Duration { get; set; } + /// Error details on execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error details on execution of this job.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfo[] ErrorDetail { get; set; } + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message on job execution.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoDynamicErrorMessage { get; set; } + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks for this job + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks for this job", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Indicated that whether the job is adhoc(true) or scheduled(false) + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicated that whether the job is adhoc(true) or scheduled(false)", + SerializedName = @"isUserTriggered", + PossibleTypes = new [] { typeof(bool) })] + bool? IsUserTriggered { get; set; } + /// Specifies friendly name of the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies friendly name of the storage account.", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountName { get; set; } + /// + /// Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account.", + SerializedName = @"storageAccountVersion", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountVersion { get; set; } + + } + /// Azure storage specific job. + internal partial interface IAzureStorageJobInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal + { + /// Gets or sets the state/actions applicable on this job like cancel/retry. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Time elapsed during the execution of this job. + global::System.TimeSpan? Duration { get; set; } + /// Error details on execution of this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfo[] ErrorDetail { get; set; } + /// Additional information about the job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfo ExtendedInfo { get; set; } + /// Non localized error message on job execution. + string ExtendedInfoDynamicErrorMessage { get; set; } + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks for this job + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Indicated that whether the job is adhoc(true) or scheduled(false) + bool? IsUserTriggered { get; set; } + /// Specifies friendly name of the storage account. + string StorageAccountName { get; set; } + /// + /// Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. + /// + string StorageAccountVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJob.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJob.json.cs new file mode 100644 index 000000000000..3eb9193d3a4a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJob.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific job. + public partial class AzureStorageJob + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureStorageJob(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureStorageJobExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonDuration ) : Duration;} + {_actionsInfo = If( json?.PropertyT("actionsInfo"), out var __jsonActionsInfo) ? If( __jsonActionsInfo as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)""))) ))() : null : ActionsInfo;} + {_errorDetail = If( json?.PropertyT("errorDetails"), out var __jsonErrorDetails) ? If( __jsonErrorDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureStorageErrorInfo.FromJson(__p) )) ))() : null : ErrorDetail;} + {_storageAccountName = If( json?.PropertyT("storageAccountName"), out var __jsonStorageAccountName) ? (string)__jsonStorageAccountName : (string)StorageAccountName;} + {_storageAccountVersion = If( json?.PropertyT("storageAccountVersion"), out var __jsonStorageAccountVersion) ? (string)__jsonStorageAccountVersion : (string)StorageAccountVersion;} + {_isUserTriggered = If( json?.PropertyT("isUserTriggered"), out var __jsonIsUserTriggered) ? (bool?)__jsonIsUserTriggered : IsUserTriggered;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJob FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureStorageJob(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __job?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)(null != this._duration ? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._duration)): null), "duration" ,container.Add ); + if (null != this._actionsInfo) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._actionsInfo ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("actionsInfo",__w); + } + if (null != this._errorDetail) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._errorDetail ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("errorDetails",__r); + } + AddIf( null != (((object)this._storageAccountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._storageAccountName.ToString()) : null, "storageAccountName" ,container.Add ); + AddIf( null != (((object)this._storageAccountVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._storageAccountVersion.ToString()) : null, "storageAccountVersion" ,container.Add ); + AddIf( null != this._isUserTriggered ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isUserTriggered) : null, "isUserTriggered" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfo.cs new file mode 100644 index 000000000000..1240ca828c5f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Storage workload-specific additional information for job. + public partial class AzureStorageJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoInternal + { + + /// Backing field for property. + private string _dynamicErrorMessage; + + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DynamicErrorMessage { get => this._dynamicErrorMessage; set => this._dynamicErrorMessage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag _propertyBag; + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureStorageJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails[] _tasksList; + + /// List of tasks for this job + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails[] TasksList { get => this._tasksList; set => this._tasksList = value; } + + /// Creates an new instance. + public AzureStorageJobExtendedInfo() + { + + } + } + /// Azure Storage workload-specific additional information for job. + public partial interface IAzureStorageJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message on job execution.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string DynamicErrorMessage { get; set; } + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks for this job + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks for this job", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails[] TasksList { get; set; } + + } + /// Azure Storage workload-specific additional information for job. + internal partial interface IAzureStorageJobExtendedInfoInternal + + { + /// Non localized error message on job execution. + string DynamicErrorMessage { get; set; } + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks for this job + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails[] TasksList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfo.json.cs new file mode 100644 index 000000000000..ae5355b9038b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Storage workload-specific additional information for job. + public partial class AzureStorageJobExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureStorageJobExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tasksList = If( json?.PropertyT("tasksList"), out var __jsonTasksList) ? If( __jsonTasksList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureStorageJobTaskDetails.FromJson(__u) )) ))() : null : TasksList;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureStorageJobExtendedInfoPropertyBag.FromJson(__jsonPropertyBag) : PropertyBag;} + {_dynamicErrorMessage = If( json?.PropertyT("dynamicErrorMessage"), out var __jsonDynamicErrorMessage) ? (string)__jsonDynamicErrorMessage : (string)DynamicErrorMessage;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureStorageJobExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._tasksList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._tasksList ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("tasksList",__w); + } + AddIf( null != this._propertyBag ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._propertyBag.ToJson(null,serializationMode) : null, "propertyBag" ,container.Add ); + AddIf( null != (((object)this._dynamicErrorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dynamicErrorMessage.ToString()) : null, "dynamicErrorMessage" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..f2d7f867872b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class AzureStorageJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBagInternal + { + + /// Creates an new instance. + public AzureStorageJobExtendedInfoPropertyBag() + { + + } + } + /// Job properties. + public partial interface IAzureStorageJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Job properties. + internal partial interface IAzureStorageJobExtendedInfoPropertyBagInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..a357e80acb21 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AzureStorageJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureStorageJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..d43730f894f9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobExtendedInfoPropertyBag.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class AzureStorageJobExtendedInfoPropertyBag + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureStorageJobExtendedInfoPropertyBag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobExtendedInfoPropertyBag FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureStorageJobExtendedInfoPropertyBag(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobTaskDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobTaskDetails.cs new file mode 100644 index 000000000000..6c3776aae281 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobTaskDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage workload specific job task details. + public partial class AzureStorageJobTaskDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetailsInternal + { + + /// Backing field for property. + private string _status; + + /// The status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string _taskId; + + /// The task display name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Creates an new instance. + public AzureStorageJobTaskDetails() + { + + } + } + /// Azure storage workload specific job task details. + public partial interface IAzureStorageJobTaskDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + /// The task display name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The task display name.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// Azure storage workload specific job task details. + internal partial interface IAzureStorageJobTaskDetailsInternal + + { + /// The status. + string Status { get; set; } + /// The task display name. + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobTaskDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobTaskDetails.json.cs new file mode 100644 index 000000000000..0035d843e2d1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageJobTaskDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage workload specific job task details. + public partial class AzureStorageJobTaskDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureStorageJobTaskDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageJobTaskDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureStorageJobTaskDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageProtectableContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageProtectableContainer.cs new file mode 100644 index 000000000000..019d4a7ff798 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageProtectableContainer.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Storage-specific protectable containers + public partial class AzureStorageProtectableContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageProtectableContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageProtectableContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer __protectableContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectableContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Fabric Id of the container such as ARM Id. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).ContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).ContainerId = value ?? null; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).HealthStatus = value ?? null; } + + /// + /// Type of the container. The value of this property for + /// 1. Compute Azure VM is Microsoft.Compute/virtualMachines + /// 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).Type = value ; } + + /// Creates an new instance. + public AzureStorageProtectableContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectableContainer), __protectableContainer); + await eventListener.AssertObjectIsValid(nameof(__protectableContainer), __protectableContainer); + } + } + /// Azure Storage-specific protectable containers + public partial interface IAzureStorageProtectableContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer + { + + } + /// Azure Storage-specific protectable containers + internal partial interface IAzureStorageProtectableContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageProtectableContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageProtectableContainer.json.cs new file mode 100644 index 000000000000..c6bf6e4d86ba --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureStorageProtectableContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Storage-specific protectable containers + public partial class AzureStorageProtectableContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureStorageProtectableContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectableContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectableContainer(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageProtectableContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageProtectableContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureStorageProtectableContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureStorageProtectableContainer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectableContainer?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectableContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectableContainer.cs new file mode 100644 index 000000000000..ac952237d27d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectableContainer.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure workload-specific container + public partial class AzureVMAppContainerProtectableContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMAppContainerProtectableContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMAppContainerProtectableContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer __protectableContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectableContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Fabric Id of the container such as ARM Id. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).ContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).ContainerId = value ?? null; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).HealthStatus = value ?? null; } + + /// + /// Type of the container. The value of this property for + /// 1. Compute Azure VM is Microsoft.Compute/virtualMachines + /// 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)__protectableContainer).Type = value ; } + + /// Creates an new instance. + public AzureVMAppContainerProtectableContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectableContainer), __protectableContainer); + await eventListener.AssertObjectIsValid(nameof(__protectableContainer), __protectableContainer); + } + } + /// Azure workload-specific container + public partial interface IAzureVMAppContainerProtectableContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer + { + + } + /// Azure workload-specific container + internal partial interface IAzureVMAppContainerProtectableContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectableContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectableContainer.json.cs new file mode 100644 index 000000000000..cc0ccdffd1b0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectableContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure workload-specific container + public partial class AzureVMAppContainerProtectableContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMAppContainerProtectableContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectableContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectableContainer(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMAppContainerProtectableContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMAppContainerProtectableContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMAppContainerProtectableContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMAppContainerProtectableContainer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectableContainer?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectionContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectionContainer.cs new file mode 100644 index 000000000000..7cb3ee6ab421 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectionContainer.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container for SQL workloads under Azure Virtual Machines. + public partial class AzureVMAppContainerProtectionContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMAppContainerProtectionContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMAppContainerProtectionContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainer __azureWorkloadContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).ContainerType = value ; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailCode; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailMessage; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailRecommendation; } + + /// Additional details of a workload container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfo = value ?? null /* model class */; } + + /// + /// Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedInfoHostServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoHostServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoHostServerName = value ?? null; } + + /// Inquiry Status for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo ExtendedInfoInquiryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoInquiryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoInquiryInfo = value ?? null /* model class */; } + + /// List of the nodes in case of distributed container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo[] ExtendedInfoNodesList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoNodesList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ExtendedInfoNodesList = value ?? null /* arrayOf */; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).HealthStatus = value ?? null; } + + /// Error Details if the Status is non-success. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail InquiryInfoErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoErrorDetail = value ?? null /* model class */; } + + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryInfoInquiryDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoInquiryDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoInquiryDetail = value ?? null /* arrayOf */; } + + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string InquiryInfoStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).InquiryInfoStatus = value ?? null; } + + /// Time stamp when this container was updated. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastUpdatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).LastUpdatedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).LastUpdatedTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailCode = value; } + + /// Internal Acessors for ErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailMessage = value; } + + /// Internal Acessors for ErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).ErrorDetailRecommendation = value; } + + /// Re-Do Operation + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType? OperationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).OperationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).OperationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType)""); } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).ProtectableObjectType = value ?? null; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__azureWorkloadContainer).RegistrationStatus = value ?? null; } + + /// ARM ID of the virtual machine represented by this Azure Workload Container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).SourceResourceId = value ?? null; } + + /// Workload type for which registration was sent. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal)__azureWorkloadContainer).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType)""); } + + /// Creates an new instance. + public AzureVMAppContainerProtectionContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadContainer), __azureWorkloadContainer); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadContainer), __azureWorkloadContainer); + } + } + /// Container for SQL workloads under Azure Virtual Machines. + public partial interface IAzureVMAppContainerProtectionContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainer + { + + } + /// Container for SQL workloads under Azure Virtual Machines. + internal partial interface IAzureVMAppContainerProtectionContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectionContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectionContainer.json.cs new file mode 100644 index 000000000000..0b848f21b54e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMAppContainerProtectionContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container for SQL workloads under Azure Virtual Machines. + public partial class AzureVMAppContainerProtectionContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMAppContainerProtectionContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadContainer(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMAppContainerProtectionContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMAppContainerProtectionContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMAppContainerProtectionContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMAppContainerProtectionContainer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadContainer?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportRequest.cs new file mode 100644 index 000000000000..8f4dae1ff4e7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureResource(IaaS VM) Specific feature support request + public partial class AzureVMResourceFeatureSupportRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMResourceFeatureSupportRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMResourceFeatureSupportRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest __featureSupportRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.FeatureSupportRequest(); + + /// backup support feature type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FeatureType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequestInternal)__featureSupportRequest).FeatureType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequestInternal)__featureSupportRequest).FeatureType = value ; } + + /// Backing field for property. + private string _vMSize; + + /// Size of the resource: VM size(A/D series etc) in case of IaasVM + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VMSize { get => this._vMSize; set => this._vMSize = value; } + + /// Backing field for property. + private string _vMSku; + + /// SKUs (Premium/Managed etc) in case of IaasVM + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VMSku { get => this._vMSku; set => this._vMSku = value; } + + /// Creates an new instance. + public AzureVMResourceFeatureSupportRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__featureSupportRequest), __featureSupportRequest); + await eventListener.AssertObjectIsValid(nameof(__featureSupportRequest), __featureSupportRequest); + } + } + /// AzureResource(IaaS VM) Specific feature support request + public partial interface IAzureVMResourceFeatureSupportRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest + { + /// Size of the resource: VM size(A/D series etc) in case of IaasVM + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Size of the resource: VM size(A/D series etc) in case of IaasVM", + SerializedName = @"vmSize", + PossibleTypes = new [] { typeof(string) })] + string VMSize { get; set; } + /// SKUs (Premium/Managed etc) in case of IaasVM + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SKUs (Premium/Managed etc) in case of IaasVM", + SerializedName = @"vmSku", + PossibleTypes = new [] { typeof(string) })] + string VMSku { get; set; } + + } + /// AzureResource(IaaS VM) Specific feature support request + internal partial interface IAzureVMResourceFeatureSupportRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequestInternal + { + /// Size of the resource: VM size(A/D series etc) in case of IaasVM + string VMSize { get; set; } + /// SKUs (Premium/Managed etc) in case of IaasVM + string VMSku { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportRequest.json.cs new file mode 100644 index 000000000000..d718cf12c93f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureResource(IaaS VM) Specific feature support request + public partial class AzureVMResourceFeatureSupportRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMResourceFeatureSupportRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __featureSupportRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.FeatureSupportRequest(json); + {_vMSize = If( json?.PropertyT("vmSize"), out var __jsonVMSize) ? (string)__jsonVMSize : (string)VMSize;} + {_vMSku = If( json?.PropertyT("vmSku"), out var __jsonVMSku) ? (string)__jsonVMSku : (string)VMSku;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMResourceFeatureSupportRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMResourceFeatureSupportRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMResourceFeatureSupportRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMResourceFeatureSupportRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __featureSupportRequest?.ToJson(container, serializationMode); + AddIf( null != (((object)this._vMSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._vMSize.ToString()) : null, "vmSize" ,container.Add ); + AddIf( null != (((object)this._vMSku)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._vMSku.ToString()) : null, "vmSku" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportResponse.cs new file mode 100644 index 000000000000..9a42bcac30a8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportResponse.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Response for feature support requests for Azure IaasVm + public partial class AzureVMResourceFeatureSupportResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMResourceFeatureSupportResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMResourceFeatureSupportResponseInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus? _supportStatus; + + /// Support status of feature + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus? SupportStatus { get => this._supportStatus; set => this._supportStatus = value; } + + /// Creates an new instance. + public AzureVMResourceFeatureSupportResponse() + { + + } + } + /// Response for feature support requests for Azure IaasVm + public partial interface IAzureVMResourceFeatureSupportResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Support status of feature + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Support status of feature", + SerializedName = @"supportStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus? SupportStatus { get; set; } + + } + /// Response for feature support requests for Azure IaasVm + internal partial interface IAzureVMResourceFeatureSupportResponseInternal + + { + /// Support status of feature + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus? SupportStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportResponse.json.cs new file mode 100644 index 000000000000..b959aa2c735a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMResourceFeatureSupportResponse.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Response for feature support requests for Azure IaasVm + public partial class AzureVMResourceFeatureSupportResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMResourceFeatureSupportResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_supportStatus = If( json?.PropertyT("supportStatus"), out var __jsonSupportStatus) ? (string)__jsonSupportStatus : (string)SupportStatus;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMResourceFeatureSupportResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMResourceFeatureSupportResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMResourceFeatureSupportResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMResourceFeatureSupportResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._supportStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._supportStatus.ToString()) : null, "supportStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadItem.cs new file mode 100644 index 000000000000..951ba7dd3efd --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item. + public partial class AzureVMWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem __workloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__workloadItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__workloadItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__workloadItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__workloadItem).FriendlyName = value ?? null; } + + /// Backing field for property. + private bool? _isAutoProtectable; + + /// Indicates if workload item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsAutoProtectable { get => this._isAutoProtectable; set => this._isAutoProtectable = value; } + + /// Backing field for property. + private string _parentName; + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ParentName { get => this._parentName; set => this._parentName = value; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__workloadItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__workloadItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Backing field for property. + private string _serverName; + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ServerName { get => this._serverName; set => this._serverName = value; } + + /// Backing field for property. + private int? _subWorkloadItemCount; + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? SubWorkloadItemCount { get => this._subWorkloadItemCount; set => this._subWorkloadItemCount = value; } + + /// Backing field for property. + private int? _subinquireditemcount; + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? Subinquireditemcount { get => this._subinquireditemcount; set => this._subinquireditemcount = value; } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__workloadItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__workloadItem).Type = value ; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__workloadItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__workloadItem).WorkloadType = value ?? null; } + + /// Creates an new instance. + public AzureVMWorkloadItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__workloadItem), __workloadItem); + await eventListener.AssertObjectIsValid(nameof(__workloadItem), __workloadItem); + } + } + /// Azure VM workload-specific workload item. + public partial interface IAzureVMWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem + { + /// Indicates if workload item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if workload item is auto-protectable", + SerializedName = @"isAutoProtectable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsAutoProtectable { get; set; } + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name for instance or AG", + SerializedName = @"parentName", + PossibleTypes = new [] { typeof(string) })] + string ParentName { get; set; } + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host/Cluster Name for instance or AG", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerName { get; set; } + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For instance or AG, indicates number of DB's to be protected", + SerializedName = @"subWorkloadItemCount", + PossibleTypes = new [] { typeof(int) })] + int? SubWorkloadItemCount { get; set; } + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For instance or AG, indicates number of DB's present", + SerializedName = @"subinquireditemcount", + PossibleTypes = new [] { typeof(int) })] + int? Subinquireditemcount { get; set; } + + } + /// Azure VM workload-specific workload item. + internal partial interface IAzureVMWorkloadItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal + { + /// Indicates if workload item is auto-protectable + bool? IsAutoProtectable { get; set; } + /// Name for instance or AG + string ParentName { get; set; } + /// Host/Cluster Name for instance or AG + string ServerName { get; set; } + /// For instance or AG, indicates number of DB's to be protected + int? SubWorkloadItemCount { get; set; } + /// For instance or AG, indicates number of DB's present + int? Subinquireditemcount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadItem.json.cs new file mode 100644 index 000000000000..7321f2095c5f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item. + public partial class AzureVMWorkloadItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __workloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadItem(json); + {_parentName = If( json?.PropertyT("parentName"), out var __jsonParentName) ? (string)__jsonParentName : (string)ParentName;} + {_serverName = If( json?.PropertyT("serverName"), out var __jsonServerName) ? (string)__jsonServerName : (string)ServerName;} + {_isAutoProtectable = If( json?.PropertyT("isAutoProtectable"), out var __jsonIsAutoProtectable) ? (bool?)__jsonIsAutoProtectable : IsAutoProtectable;} + {_subinquireditemcount = If( json?.PropertyT("subinquireditemcount"), out var __jsonSubinquireditemcount) ? (int?)__jsonSubinquireditemcount : Subinquireditemcount;} + {_subWorkloadItemCount = If( json?.PropertyT("subWorkloadItemCount"), out var __jsonSubWorkloadItemCount) ? (int?)__jsonSubWorkloadItemCount : SubWorkloadItemCount;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("workloadItemType") ) + { + case "SAPAseDatabase": + { + return new AzureVMWorkloadSapAseDatabaseWorkloadItem(json); + } + case "SAPAseSystem": + { + return new AzureVMWorkloadSapAseSystemWorkloadItem(json); + } + case "SAPHanaDatabase": + { + return new AzureVMWorkloadSapHanaDatabaseWorkloadItem(json); + } + case "SAPHanaSystem": + { + return new AzureVMWorkloadSapHanaSystemWorkloadItem(json); + } + case "SQLDataBase": + { + return new AzureVMWorkloadSqlDatabaseWorkloadItem(json); + } + case "SQLInstance": + { + return new AzureVMWorkloadSqlInstanceWorkloadItem(json); + } + } + return new AzureVMWorkloadItem(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __workloadItem?.ToJson(container, serializationMode); + AddIf( null != (((object)this._parentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._parentName.ToString()) : null, "parentName" ,container.Add ); + AddIf( null != (((object)this._serverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._serverName.ToString()) : null, "serverName" ,container.Add ); + AddIf( null != this._isAutoProtectable ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isAutoProtectable) : null, "isAutoProtectable" ,container.Add ); + AddIf( null != this._subinquireditemcount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._subinquireditemcount) : null, "subinquireditemcount" ,container.Add ); + AddIf( null != this._subWorkloadItemCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._subWorkloadItemCount) : null, "subWorkloadItemCount" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectableItem.cs new file mode 100644 index 000000000000..2df812875539 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectableItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item. + public partial class AzureVMWorkloadProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem __workloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).FriendlyName = value ?? null; } + + /// Backing field for property. + private bool? _isAutoProtectable; + + /// Indicates if protectable item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsAutoProtectable { get => this._isAutoProtectable; set => this._isAutoProtectable = value; } + + /// Backing field for property. + private bool? _isAutoProtected; + + /// Indicates if protectable item is auto-protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsAutoProtected { get => this._isAutoProtected; set => this._isAutoProtected = value; } + + /// Internal Acessors for Prebackupvalidation + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal.Prebackupvalidation { get => (this._prebackupvalidation = this._prebackupvalidation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PreBackupValidation()); set { {_prebackupvalidation = value;} } } + + /// Backing field for property. + private string _parentName; + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ParentName { get => this._parentName; set => this._parentName = value; } + + /// Backing field for property. + private string _parentUniqueName; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ParentUniqueName { get => this._parentUniqueName; set => this._parentUniqueName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation _prebackupvalidation; + + /// Pre-backup validation for protectable objects + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation Prebackupvalidation { get => (this._prebackupvalidation = this._prebackupvalidation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PreBackupValidation()); set => this._prebackupvalidation = value; } + + /// Error code of protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PrebackupvalidationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidationInternal)Prebackupvalidation).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidationInternal)Prebackupvalidation).Code = value ?? null; } + + /// Message corresponding to the error code for the protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PrebackupvalidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidationInternal)Prebackupvalidation).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidationInternal)Prebackupvalidation).Message = value ?? null; } + + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? PrebackupvalidationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidationInternal)Prebackupvalidation).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidationInternal)Prebackupvalidation).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus)""); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Backing field for property. + private string _serverName; + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ServerName { get => this._serverName; set => this._serverName = value; } + + /// Backing field for property. + private int? _subinquireditemcount; + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? Subinquireditemcount { get => this._subinquireditemcount; set => this._subinquireditemcount = value; } + + /// Backing field for property. + private int? _subprotectableitemcount; + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? Subprotectableitemcount { get => this._subprotectableitemcount; set => this._subprotectableitemcount = value; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).WorkloadType = value ?? null; } + + /// Creates an new instance. + public AzureVMWorkloadProtectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__workloadProtectableItem), __workloadProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__workloadProtectableItem), __workloadProtectableItem); + } + } + /// Azure VM workload-specific protectable item. + public partial interface IAzureVMWorkloadProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem + { + /// Indicates if protectable item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if protectable item is auto-protectable", + SerializedName = @"isAutoProtectable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsAutoProtectable { get; set; } + /// Indicates if protectable item is auto-protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if protectable item is auto-protected", + SerializedName = @"isAutoProtected", + PossibleTypes = new [] { typeof(bool) })] + bool? IsAutoProtected { get; set; } + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name for instance or AG", + SerializedName = @"parentName", + PossibleTypes = new [] { typeof(string) })] + string ParentName { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"parentUniqueName", + PossibleTypes = new [] { typeof(string) })] + string ParentUniqueName { get; set; } + /// Error code of protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code of protectable item", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string PrebackupvalidationCode { get; set; } + /// Message corresponding to the error code for the protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Message corresponding to the error code for the protectable item", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string PrebackupvalidationMessage { get; set; } + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of protectable item, i.e. InProgress,Succeeded,Failed", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? PrebackupvalidationStatus { get; set; } + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host/Cluster Name for instance or AG", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerName { get; set; } + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For instance or AG, indicates number of DB's present", + SerializedName = @"subinquireditemcount", + PossibleTypes = new [] { typeof(int) })] + int? Subinquireditemcount { get; set; } + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For instance or AG, indicates number of DB's to be protected", + SerializedName = @"subprotectableitemcount", + PossibleTypes = new [] { typeof(int) })] + int? Subprotectableitemcount { get; set; } + + } + /// Azure VM workload-specific protectable item. + internal partial interface IAzureVMWorkloadProtectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal + { + /// Indicates if protectable item is auto-protectable + bool? IsAutoProtectable { get; set; } + /// Indicates if protectable item is auto-protected + bool? IsAutoProtected { get; set; } + /// Name for instance or AG + string ParentName { get; set; } + /// + /// 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. + /// + string ParentUniqueName { get; set; } + /// Pre-backup validation for protectable objects + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation Prebackupvalidation { get; set; } + /// Error code of protectable item + string PrebackupvalidationCode { get; set; } + /// Message corresponding to the error code for the protectable item + string PrebackupvalidationMessage { get; set; } + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? PrebackupvalidationStatus { get; set; } + /// Host/Cluster Name for instance or AG + string ServerName { get; set; } + /// For instance or AG, indicates number of DB's present + int? Subinquireditemcount { get; set; } + /// For instance or AG, indicates number of DB's to be protected + int? Subprotectableitemcount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectableItem.json.cs new file mode 100644 index 000000000000..648b48709db1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item. + public partial class AzureVMWorkloadProtectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadProtectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __workloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItem(json); + {_prebackupvalidation = If( json?.PropertyT("prebackupvalidation"), out var __jsonPrebackupvalidation) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PreBackupValidation.FromJson(__jsonPrebackupvalidation) : Prebackupvalidation;} + {_parentName = If( json?.PropertyT("parentName"), out var __jsonParentName) ? (string)__jsonParentName : (string)ParentName;} + {_parentUniqueName = If( json?.PropertyT("parentUniqueName"), out var __jsonParentUniqueName) ? (string)__jsonParentUniqueName : (string)ParentUniqueName;} + {_serverName = If( json?.PropertyT("serverName"), out var __jsonServerName) ? (string)__jsonServerName : (string)ServerName;} + {_isAutoProtectable = If( json?.PropertyT("isAutoProtectable"), out var __jsonIsAutoProtectable) ? (bool?)__jsonIsAutoProtectable : IsAutoProtectable;} + {_isAutoProtected = If( json?.PropertyT("isAutoProtected"), out var __jsonIsAutoProtected) ? (bool?)__jsonIsAutoProtected : IsAutoProtected;} + {_subinquireditemcount = If( json?.PropertyT("subinquireditemcount"), out var __jsonSubinquireditemcount) ? (int?)__jsonSubinquireditemcount : Subinquireditemcount;} + {_subprotectableitemcount = If( json?.PropertyT("subprotectableitemcount"), out var __jsonSubprotectableitemcount) ? (int?)__jsonSubprotectableitemcount : Subprotectableitemcount;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("protectableItemType") ) + { + case "SAPAseSystem": + { + return new AzureVMWorkloadSapAseSystemProtectableItem(json); + } + case "SAPHanaDatabase": + { + return new AzureVMWorkloadSapHanaDatabaseProtectableItem(json); + } + case "SAPHanaSystem": + { + return new AzureVMWorkloadSapHanaSystemProtectableItem(json); + } + case "SQLAvailabilityGroupContainer": + { + return new AzureVMWorkloadSqlAvailabilityGroupProtectableItem(json); + } + case "SQLDataBase": + { + return new AzureVMWorkloadSqlDatabaseProtectableItem(json); + } + case "SQLInstance": + { + return new AzureVMWorkloadSqlInstanceProtectableItem(json); + } + } + return new AzureVMWorkloadProtectableItem(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __workloadProtectableItem?.ToJson(container, serializationMode); + AddIf( null != this._prebackupvalidation ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._prebackupvalidation.ToJson(null,serializationMode) : null, "prebackupvalidation" ,container.Add ); + AddIf( null != (((object)this._parentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._parentName.ToString()) : null, "parentName" ,container.Add ); + AddIf( null != (((object)this._parentUniqueName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._parentUniqueName.ToString()) : null, "parentUniqueName" ,container.Add ); + AddIf( null != (((object)this._serverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._serverName.ToString()) : null, "serverName" ,container.Add ); + AddIf( null != this._isAutoProtectable ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isAutoProtectable) : null, "isAutoProtectable" ,container.Add ); + AddIf( null != this._isAutoProtected ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isAutoProtected) : null, "isAutoProtected" ,container.Add ); + AddIf( null != this._subinquireditemcount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._subinquireditemcount) : null, "subinquireditemcount" ,container.Add ); + AddIf( null != this._subprotectableitemcount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._subprotectableitemcount) : null, "subprotectableitemcount" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItem.cs new file mode 100644 index 000000000000..896da9cd2ea8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItem.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protected item. + public partial class AzureVMWorkloadProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo _extendedInfo; + + /// Additional information for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItemExtendedInfo()); set => this._extendedInfo = value; } + + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).NewestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).NewestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPointInVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPointInVault = value ?? default(global::System.DateTime); } + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyState = value ?? null; } + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoRecoveryModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryModel; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryModel = value ?? null; } + + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount = value ?? default(int); } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the DB represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths _kpisHealth; + + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get => (this._kpisHealth = this._kpisHealth ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItemKpisHealths()); set => this._kpisHealth = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail _lastBackupErrorDetail; + + /// Error details in last backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail LastBackupErrorDetail { get => (this._lastBackupErrorDetail = this._lastBackupErrorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail()); set => this._lastBackupErrorDetail = value; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)LastBackupErrorDetail).Code; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)LastBackupErrorDetail).Message; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)LastBackupErrorDetail).Recommendation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus? _lastBackupStatus; + + /// Last backup operation status. Possible values: Healthy, Unhealthy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus? LastBackupStatus { get => this._lastBackupStatus; set => this._lastBackupStatus = value; } + + /// Backing field for property. + private global::System.DateTime? _lastBackupTime; + + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? LastBackupTime { get => this._lastBackupTime; set => this._lastBackupTime = value; } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItemExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Internal Acessors for LastBackupErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetail { get => (this._lastBackupErrorDetail = this._lastBackupErrorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail()); set { {_lastBackupErrorDetail = value;} } } + + /// Internal Acessors for LastBackupErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)LastBackupErrorDetail).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)LastBackupErrorDetail).Code = value; } + + /// Internal Acessors for LastBackupErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)LastBackupErrorDetail).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)LastBackupErrorDetail).Message = value; } + + /// Internal Acessors for LastBackupErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)LastBackupErrorDetail).Recommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)LastBackupErrorDetail).Recommendation = value; } + + /// Backing field for property. + private string _parentName; + + /// Parent name of the DB such as Instance or Availability Group. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ParentName { get => this._parentName; set => this._parentName = value; } + + /// Backing field for property. + private string _parentType; + + /// + /// Parent type of protected item, example: for a DB, standalone server or distributed + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ParentType { get => this._parentType; set => this._parentType = value; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName = value ?? null; } + + /// Backing field for property. + private string _protectedItemDataSourceId; + + /// Data ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectedItemDataSourceId { get => this._protectedItemDataSourceId; set => this._protectedItemDataSourceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus? _protectedItemHealthStatus; + + /// Health status of the backup item, evaluated based on last heartbeat received + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus? ProtectedItemHealthStatus { get => this._protectedItemHealthStatus; set => this._protectedItemHealthStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? _protectionState; + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get => this._protectionState; set => this._protectionState = value; } + + /// Backing field for property. + private string _protectionStatus; + + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectionStatus { get => this._protectionStatus; set => this._protectionStatus = value; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _serverName; + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ServerName { get => this._serverName; set => this._serverName = value; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type = value ; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public AzureVMWorkloadProtectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectedItem), __protectedItem); + await eventListener.AssertObjectIsValid(nameof(__protectedItem), __protectedItem); + } + } + /// Azure VM workload-specific protected item. + public partial interface IAzureVMWorkloadProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem + { + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The latest backup copy available for this backup item in archive tier", + SerializedName = @"newestRecoveryPointInArchive", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item across all tiers.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item in archive tier", + SerializedName = @"oldestRecoveryPointInArchive", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item in vault tier", + SerializedName = @"oldestRecoveryPointInVault", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates consistency of policy object and policy applied to this backup item.", + SerializedName = @"policyState", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoPolicyState { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates consistency of policy object and policy applied to this backup item.", + SerializedName = @"recoveryModel", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoRecoveryModel { get; set; } + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of backup copies available for this backup item.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoRecoveryPointCount { get; set; } + /// Friendly name of the DB represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the DB represented by this backup item.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health details of different KPIs", + SerializedName = @"kpisHealths", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get; set; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string LastBackupErrorDetailCode { get; } + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message related to the Code.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string LastBackupErrorDetailMessage { get; } + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of recommendation strings.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] LastBackupErrorDetailRecommendation { get; } + /// Last backup operation status. Possible values: Healthy, Unhealthy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last backup operation status. Possible values: Healthy, Unhealthy.", + SerializedName = @"lastBackupStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus? LastBackupStatus { get; set; } + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Timestamp of the last backup operation on this backup item.", + SerializedName = @"lastBackupTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastBackupTime { get; set; } + /// Parent name of the DB such as Instance or Availability Group. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parent name of the DB such as Instance or Availability Group.", + SerializedName = @"parentName", + PossibleTypes = new [] { typeof(string) })] + string ParentName { get; set; } + /// + /// Parent type of protected item, example: for a DB, standalone server or distributed + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parent type of protected item, example: for a DB, standalone server or distributed", + SerializedName = @"parentType", + PossibleTypes = new [] { typeof(string) })] + string ParentType { get; set; } + /// Data ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data ID of the protected item.", + SerializedName = @"protectedItemDataSourceId", + PossibleTypes = new [] { typeof(string) })] + string ProtectedItemDataSourceId { get; set; } + /// Health status of the backup item, evaluated based on last heartbeat received + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health status of the backup item, evaluated based on last heartbeat received", + SerializedName = @"protectedItemHealthStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus? ProtectedItemHealthStatus { get; set; } + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup state of this backup item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get; set; } + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup status of this backup item.", + SerializedName = @"protectionStatus", + PossibleTypes = new [] { typeof(string) })] + string ProtectionStatus { get; set; } + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host/Cluster Name for instance or AG", + SerializedName = @"serverName", + PossibleTypes = new [] { typeof(string) })] + string ServerName { get; set; } + + } + /// Azure VM workload-specific protected item. + internal partial interface IAzureVMWorkloadProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal + { + /// Additional information for this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo ExtendedInfo { get; set; } + /// The latest backup copy available for this backup item in archive tier + global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item across all tiers. + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// The oldest backup copy available for this backup item in archive tier + global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item in vault tier + global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + string ExtendedInfoPolicyState { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + string ExtendedInfoRecoveryModel { get; set; } + /// Number of backup copies available for this backup item. + int? ExtendedInfoRecoveryPointCount { get; set; } + /// Friendly name of the DB represented by this backup item. + string FriendlyName { get; set; } + /// Health details of different KPIs + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get; set; } + /// Error details in last backup + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail LastBackupErrorDetail { get; set; } + /// Error code. + string LastBackupErrorDetailCode { get; set; } + /// Error Message related to the Code. + string LastBackupErrorDetailMessage { get; set; } + /// List of recommendation strings. + string[] LastBackupErrorDetailRecommendation { get; set; } + /// Last backup operation status. Possible values: Healthy, Unhealthy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus? LastBackupStatus { get; set; } + /// Timestamp of the last backup operation on this backup item. + global::System.DateTime? LastBackupTime { get; set; } + /// Parent name of the DB such as Instance or Availability Group. + string ParentName { get; set; } + /// + /// Parent type of protected item, example: for a DB, standalone server or distributed + /// + string ParentType { get; set; } + /// Data ID of the protected item. + string ProtectedItemDataSourceId { get; set; } + /// Health status of the backup item, evaluated based on last heartbeat received + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus? ProtectedItemHealthStatus { get; set; } + /// Backup state of this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get; set; } + /// Backup status of this backup item. + string ProtectionStatus { get; set; } + /// Host/Cluster Name for instance or AG + string ServerName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItem.json.cs new file mode 100644 index 000000000000..f6fd39068484 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protected item. + public partial class AzureVMWorkloadProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(json); + {_lastBackupErrorDetail = If( json?.PropertyT("lastBackupErrorDetail"), out var __jsonLastBackupErrorDetail) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail.FromJson(__jsonLastBackupErrorDetail) : LastBackupErrorDetail;} + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItemExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_serverName = If( json?.PropertyT("serverName"), out var __jsonServerName) ? (string)__jsonServerName : (string)ServerName;} + {_parentName = If( json?.PropertyT("parentName"), out var __jsonParentName) ? (string)__jsonParentName : (string)ParentName;} + {_parentType = If( json?.PropertyT("parentType"), out var __jsonParentType) ? (string)__jsonParentType : (string)ParentType;} + {_protectionStatus = If( json?.PropertyT("protectionStatus"), out var __jsonProtectionStatus) ? (string)__jsonProtectionStatus : (string)ProtectionStatus;} + {_protectionState = If( json?.PropertyT("protectionState"), out var __jsonProtectionState) ? (string)__jsonProtectionState : (string)ProtectionState;} + {_lastBackupStatus = If( json?.PropertyT("lastBackupStatus"), out var __jsonLastBackupStatus) ? (string)__jsonLastBackupStatus : (string)LastBackupStatus;} + {_lastBackupTime = If( json?.PropertyT("lastBackupTime"), out var __jsonLastBackupTime) ? global::System.DateTime.TryParse((string)__jsonLastBackupTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastBackupTimeValue) ? __jsonLastBackupTimeValue : LastBackupTime : LastBackupTime;} + {_protectedItemDataSourceId = If( json?.PropertyT("protectedItemDataSourceId"), out var __jsonProtectedItemDataSourceId) ? (string)__jsonProtectedItemDataSourceId : (string)ProtectedItemDataSourceId;} + {_protectedItemHealthStatus = If( json?.PropertyT("protectedItemHealthStatus"), out var __jsonProtectedItemHealthStatus) ? (string)__jsonProtectedItemHealthStatus : (string)ProtectedItemHealthStatus;} + {_kpisHealth = If( json?.PropertyT("kpisHealths"), out var __jsonKpisHealths) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItemKpisHealths.FromJson(__jsonKpisHealths) : KpisHealth;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("protectedItemType") ) + { + case "AzureVmWorkloadSAPAseDatabase": + { + return new AzureVMWorkloadSapAseDatabaseProtectedItem(json); + } + case "AzureVmWorkloadSAPHanaDatabase": + { + return new AzureVMWorkloadSapHanaDatabaseProtectedItem(json); + } + case "AzureVmWorkloadSQLDatabase": + { + return new AzureVMWorkloadSqlDatabaseProtectedItem(json); + } + } + return new AzureVMWorkloadProtectedItem(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectedItem?.ToJson(container, serializationMode); + AddIf( null != this._lastBackupErrorDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._lastBackupErrorDetail.ToJson(null,serializationMode) : null, "lastBackupErrorDetail" ,container.Add ); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._serverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._serverName.ToString()) : null, "serverName" ,container.Add ); + AddIf( null != (((object)this._parentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._parentName.ToString()) : null, "parentName" ,container.Add ); + AddIf( null != (((object)this._parentType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._parentType.ToString()) : null, "parentType" ,container.Add ); + AddIf( null != (((object)this._protectionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionStatus.ToString()) : null, "protectionStatus" ,container.Add ); + AddIf( null != (((object)this._protectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionState.ToString()) : null, "protectionState" ,container.Add ); + AddIf( null != (((object)this._lastBackupStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastBackupStatus.ToString()) : null, "lastBackupStatus" ,container.Add ); + AddIf( null != this._lastBackupTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastBackupTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastBackupTime" ,container.Add ); + AddIf( null != (((object)this._protectedItemDataSourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectedItemDataSourceId.ToString()) : null, "protectedItemDataSourceId" ,container.Add ); + AddIf( null != (((object)this._protectedItemHealthStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectedItemHealthStatus.ToString()) : null, "protectedItemHealthStatus" ,container.Add ); + AddIf( null != this._kpisHealth ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._kpisHealth.ToJson(null,serializationMode) : null, "kpisHealths" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..61f7b155d33d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on Azure Workload for SQL specific backup item. + public partial class AzureVMWorkloadProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfoInternal + { + + /// Backing field for property. + private global::System.DateTime? _newestRecoveryPointInArchive; + + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? NewestRecoveryPointInArchive { get => this._newestRecoveryPointInArchive; set => this._newestRecoveryPointInArchive = value; } + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPoint; + + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OldestRecoveryPoint { get => this._oldestRecoveryPoint; set => this._oldestRecoveryPoint = value; } + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPointInArchive; + + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OldestRecoveryPointInArchive { get => this._oldestRecoveryPointInArchive; set => this._oldestRecoveryPointInArchive = value; } + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPointInVault; + + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OldestRecoveryPointInVault { get => this._oldestRecoveryPointInVault; set => this._oldestRecoveryPointInVault = value; } + + /// Backing field for property. + private string _policyState; + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyState { get => this._policyState; set => this._policyState = value; } + + /// Backing field for property. + private string _recoveryModel; + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryModel { get => this._recoveryModel; set => this._recoveryModel = value; } + + /// Backing field for property. + private int? _recoveryPointCount; + + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? RecoveryPointCount { get => this._recoveryPointCount; set => this._recoveryPointCount = value; } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadProtectedItemExtendedInfo() + { + + } + } + /// Additional information on Azure Workload for SQL specific backup item. + public partial interface IAzureVMWorkloadProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The latest backup copy available for this backup item in archive tier", + SerializedName = @"newestRecoveryPointInArchive", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? NewestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item across all tiers.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item in archive tier", + SerializedName = @"oldestRecoveryPointInArchive", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item in vault tier", + SerializedName = @"oldestRecoveryPointInVault", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPointInVault { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates consistency of policy object and policy applied to this backup item.", + SerializedName = @"policyState", + PossibleTypes = new [] { typeof(string) })] + string PolicyState { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates consistency of policy object and policy applied to this backup item.", + SerializedName = @"recoveryModel", + PossibleTypes = new [] { typeof(string) })] + string RecoveryModel { get; set; } + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of backup copies available for this backup item.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? RecoveryPointCount { get; set; } + + } + /// Additional information on Azure Workload for SQL specific backup item. + internal partial interface IAzureVMWorkloadProtectedItemExtendedInfoInternal + + { + /// The latest backup copy available for this backup item in archive tier + global::System.DateTime? NewestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item across all tiers. + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// The oldest backup copy available for this backup item in archive tier + global::System.DateTime? OldestRecoveryPointInArchive { get; set; } + /// The oldest backup copy available for this backup item in vault tier + global::System.DateTime? OldestRecoveryPointInVault { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + string PolicyState { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + string RecoveryModel { get; set; } + /// Number of backup copies available for this backup item. + int? RecoveryPointCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..a1be8f1308b6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on Azure Workload for SQL specific backup item. + public partial class AzureVMWorkloadProtectedItemExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadProtectedItemExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_oldestRecoveryPoint = If( json?.PropertyT("oldestRecoveryPoint"), out var __jsonOldestRecoveryPoint) ? global::System.DateTime.TryParse((string)__jsonOldestRecoveryPoint, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOldestRecoveryPointValue) ? __jsonOldestRecoveryPointValue : OldestRecoveryPoint : OldestRecoveryPoint;} + {_oldestRecoveryPointInVault = If( json?.PropertyT("oldestRecoveryPointInVault"), out var __jsonOldestRecoveryPointInVault) ? global::System.DateTime.TryParse((string)__jsonOldestRecoveryPointInVault, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOldestRecoveryPointInVaultValue) ? __jsonOldestRecoveryPointInVaultValue : OldestRecoveryPointInVault : OldestRecoveryPointInVault;} + {_oldestRecoveryPointInArchive = If( json?.PropertyT("oldestRecoveryPointInArchive"), out var __jsonOldestRecoveryPointInArchive) ? global::System.DateTime.TryParse((string)__jsonOldestRecoveryPointInArchive, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOldestRecoveryPointInArchiveValue) ? __jsonOldestRecoveryPointInArchiveValue : OldestRecoveryPointInArchive : OldestRecoveryPointInArchive;} + {_newestRecoveryPointInArchive = If( json?.PropertyT("newestRecoveryPointInArchive"), out var __jsonNewestRecoveryPointInArchive) ? global::System.DateTime.TryParse((string)__jsonNewestRecoveryPointInArchive, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonNewestRecoveryPointInArchiveValue) ? __jsonNewestRecoveryPointInArchiveValue : NewestRecoveryPointInArchive : NewestRecoveryPointInArchive;} + {_recoveryPointCount = If( json?.PropertyT("recoveryPointCount"), out var __jsonRecoveryPointCount) ? (int?)__jsonRecoveryPointCount : RecoveryPointCount;} + {_policyState = If( json?.PropertyT("policyState"), out var __jsonPolicyState) ? (string)__jsonPolicyState : (string)PolicyState;} + {_recoveryModel = If( json?.PropertyT("recoveryModel"), out var __jsonRecoveryModel) ? (string)__jsonRecoveryModel : (string)RecoveryModel;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadProtectedItemExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._oldestRecoveryPoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oldestRecoveryPoint?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "oldestRecoveryPoint" ,container.Add ); + AddIf( null != this._oldestRecoveryPointInVault ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oldestRecoveryPointInVault?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "oldestRecoveryPointInVault" ,container.Add ); + AddIf( null != this._oldestRecoveryPointInArchive ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oldestRecoveryPointInArchive?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "oldestRecoveryPointInArchive" ,container.Add ); + AddIf( null != this._newestRecoveryPointInArchive ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._newestRecoveryPointInArchive?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "newestRecoveryPointInArchive" ,container.Add ); + AddIf( null != this._recoveryPointCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._recoveryPointCount) : null, "recoveryPointCount" ,container.Add ); + AddIf( null != (((object)this._policyState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyState.ToString()) : null, "policyState" ,container.Add ); + AddIf( null != (((object)this._recoveryModel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryModel.ToString()) : null, "recoveryModel" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.cs new file mode 100644 index 000000000000..ed0968cf5c4c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health details of different KPIs + public partial class AzureVMWorkloadProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealthsInternal + { + + /// Creates an new instance. + public AzureVMWorkloadProtectedItemKpisHealths() + { + + } + } + /// Health details of different KPIs + public partial interface IAzureVMWorkloadProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Health details of different KPIs + internal partial interface IAzureVMWorkloadProtectedItemKpisHealthsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.dictionary.cs new file mode 100644 index 000000000000..d22f9874845a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AzureVMWorkloadProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItemKpisHealths source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.json.cs new file mode 100644 index 000000000000..d12f1626a345 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectedItemKpisHealths.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health details of different KPIs + public partial class AzureVMWorkloadProtectedItemKpisHealths + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureVMWorkloadProtectedItemKpisHealths(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.KpiResourceHealthDetails.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadProtectedItemKpisHealths(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectionPolicy.cs new file mode 100644 index 000000000000..f27cda4d7508 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectionPolicy.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM (Mercury) workload-specific backup policy. + public partial class AzureVMWorkloadProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectionPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType = value ; } + + /// Backing field for property. + private bool? _makePolicyConsistent; + + /// Fix the policy inconsistency + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? MakePolicyConsistent { get => this._makePolicyConsistent; set => this._makePolicyConsistent = value; } + + /// Internal Acessors for Setting + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettings Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectionPolicyInternal.Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Settings()); set { {_setting = value;} } } + + /// Number of items associated with this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount = value ?? default(int); } + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettings _setting; + + /// Common settings for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Settings()); set => this._setting = value; } + + /// + /// Workload compression flag. This has been added so that 'isSqlCompression' + /// will be deprecated once clients upgrade to consider this flag. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? SettingIsCompression { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettingsInternal)Setting).IsCompression; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettingsInternal)Setting).IsCompression = value ?? default(bool); } + + /// SQL compression flag + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? SettingIssqlcompression { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettingsInternal)Setting).Issqlcompression; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettingsInternal)Setting).Issqlcompression = value ?? default(bool); } + + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string SettingTimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettingsInternal)Setting).TimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettingsInternal)Setting).TimeZone = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy[] _subProtectionPolicy; + + /// List of sub-protection policies which includes schedule and retention + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy[] SubProtectionPolicy { get => this._subProtectionPolicy; set => this._subProtectionPolicy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? _workLoadType; + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkLoadType { get => this._workLoadType; set => this._workLoadType = value; } + + /// Creates an new instance. + public AzureVMWorkloadProtectionPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionPolicy), __protectionPolicy); + await eventListener.AssertObjectIsValid(nameof(__protectionPolicy), __protectionPolicy); + } + } + /// Azure VM (Mercury) workload-specific backup policy. + public partial interface IAzureVMWorkloadProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy + { + /// Fix the policy inconsistency + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fix the policy inconsistency", + SerializedName = @"makePolicyConsistent", + PossibleTypes = new [] { typeof(bool) })] + bool? MakePolicyConsistent { get; set; } + /// + /// Workload compression flag. This has been added so that 'isSqlCompression' + /// will be deprecated once clients upgrade to consider this flag. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload compression flag. This has been added so that 'isSqlCompression' + will be deprecated once clients upgrade to consider this flag.", + SerializedName = @"isCompression", + PossibleTypes = new [] { typeof(bool) })] + bool? SettingIsCompression { get; set; } + /// SQL compression flag + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SQL compression flag", + SerializedName = @"issqlcompression", + PossibleTypes = new [] { typeof(bool) })] + bool? SettingIssqlcompression { get; set; } + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"TimeZone optional input as string. For example: TimeZone = ""Pacific Standard Time"".", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string SettingTimeZone { get; set; } + /// List of sub-protection policies which includes schedule and retention + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of sub-protection policies which includes schedule and retention", + SerializedName = @"subProtectionPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy[] SubProtectionPolicy { get; set; } + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of workload for the backup management", + SerializedName = @"workLoadType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkLoadType { get; set; } + + } + /// Azure VM (Mercury) workload-specific backup policy. + internal partial interface IAzureVMWorkloadProtectionPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal + { + /// Fix the policy inconsistency + bool? MakePolicyConsistent { get; set; } + /// Common settings for the backup management + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettings Setting { get; set; } + /// + /// Workload compression flag. This has been added so that 'isSqlCompression' + /// will be deprecated once clients upgrade to consider this flag. + /// + bool? SettingIsCompression { get; set; } + /// SQL compression flag + bool? SettingIssqlcompression { get; set; } + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + string SettingTimeZone { get; set; } + /// List of sub-protection policies which includes schedule and retention + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy[] SubProtectionPolicy { get; set; } + /// Type of workload for the backup management + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkLoadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectionPolicy.json.cs new file mode 100644 index 000000000000..583f54567176 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadProtectionPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM (Mercury) workload-specific backup policy. + public partial class AzureVMWorkloadProtectionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadProtectionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(json); + {_setting = If( json?.PropertyT("settings"), out var __jsonSettings) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Settings.FromJson(__jsonSettings) : Setting;} + {_workLoadType = If( json?.PropertyT("workLoadType"), out var __jsonWorkLoadType) ? (string)__jsonWorkLoadType : (string)WorkLoadType;} + {_subProtectionPolicy = If( json?.PropertyT("subProtectionPolicy"), out var __jsonSubProtectionPolicy) ? If( __jsonSubProtectionPolicy as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SubProtectionPolicy.FromJson(__u) )) ))() : null : SubProtectionPolicy;} + {_makePolicyConsistent = If( json?.PropertyT("makePolicyConsistent"), out var __jsonMakePolicyConsistent) ? (bool?)__jsonMakePolicyConsistent : MakePolicyConsistent;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadProtectionPolicy(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionPolicy?.ToJson(container, serializationMode); + AddIf( null != this._setting ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._setting.ToJson(null,serializationMode) : null, "settings" ,container.Add ); + AddIf( null != (((object)this._workLoadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workLoadType.ToString()) : null, "workLoadType" ,container.Add ); + if (null != this._subProtectionPolicy) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._subProtectionPolicy ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("subProtectionPolicy",__w); + } + AddIf( null != this._makePolicyConsistent ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._makePolicyConsistent) : null, "makePolicyConsistent" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseProtectedItem.cs new file mode 100644 index 000000000000..326a7500042f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseProtectedItem.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protected item representing SAP ASE Database. + public partial class AzureVMWorkloadSapAseDatabaseProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseDatabaseProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseDatabaseProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem __azureVMWorkloadProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Additional information for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo = value ?? null /* model class */; } + + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoNewestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoNewestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInVault = value ?? default(global::System.DateTime); } + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedInfoPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState = value ?? null; } + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedInfoRecoveryModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryModel; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryModel = value ?? null; } + + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryPointCount = value ?? default(int); } + + /// Friendly name of the DB represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName = value ?? null; } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).KpisHealth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).KpisHealth = value ?? null /* model class */; } + + /// Error details in last backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail LastBackupErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetail = value ?? null /* model class */; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation; } + + /// Last backup operation status. Possible values: Healthy, Unhealthy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus? LastBackupStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus)""); } + + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastBackupTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupTime = value ?? default(global::System.DateTime); } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for LastBackupErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode = value; } + + /// Internal Acessors for LastBackupErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage = value; } + + /// Internal Acessors for LastBackupErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation = value; } + + /// Parent name of the DB such as Instance or Availability Group. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentName = value ?? null; } + + /// + /// Parent type of protected item, example: for a DB, standalone server or distributed + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentType = value ?? null; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyName = value ?? null; } + + /// Data ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectedItemDataSourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemDataSourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemDataSourceId = value ?? null; } + + /// Health status of the backup item, evaluated based on last heartbeat received + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus? ProtectedItemHealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemHealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemHealthStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus)""); } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState)""); } + + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionStatus = value ?? null; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ServerName = value ?? null; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).Type = value ; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSapAseDatabaseProtectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadProtectedItem), __azureVMWorkloadProtectedItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadProtectedItem), __azureVMWorkloadProtectedItem); + } + } + /// Azure VM workload-specific protected item representing SAP ASE Database. + public partial interface IAzureVMWorkloadSapAseDatabaseProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem + { + + } + /// Azure VM workload-specific protected item representing SAP ASE Database. + internal partial interface IAzureVMWorkloadSapAseDatabaseProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseProtectedItem.json.cs new file mode 100644 index 000000000000..40fa0815439e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseProtectedItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protected item representing SAP ASE Database. + public partial class AzureVMWorkloadSapAseDatabaseProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSapAseDatabaseProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseDatabaseProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseDatabaseProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseDatabaseProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSapAseDatabaseProtectedItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadProtectedItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseWorkloadItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseWorkloadItem.cs new file mode 100644 index 000000000000..71ea85ff3315 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseWorkloadItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SAP ASE Database. + public partial class AzureVMWorkloadSapAseDatabaseWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseDatabaseWorkloadItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseDatabaseWorkloadItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName = value ?? null; } + + /// Indicates if workload item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName = value ?? null; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? SubWorkloadItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount = value ?? default(int); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type = value ; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSapAseDatabaseWorkloadItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + } + } + /// Azure VM workload-specific workload item representing SAP ASE Database. + public partial interface IAzureVMWorkloadSapAseDatabaseWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem + { + + } + /// Azure VM workload-specific workload item representing SAP ASE Database. + internal partial interface IAzureVMWorkloadSapAseDatabaseWorkloadItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseWorkloadItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseWorkloadItem.json.cs new file mode 100644 index 000000000000..8047d4d1398b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseDatabaseWorkloadItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SAP ASE Database. + public partial class AzureVMWorkloadSapAseDatabaseWorkloadItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSapAseDatabaseWorkloadItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseDatabaseWorkloadItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseDatabaseWorkloadItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseDatabaseWorkloadItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSapAseDatabaseWorkloadItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemProtectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemProtectableItem.cs new file mode 100644 index 000000000000..aab6492a7bdc --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemProtectableItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item representing SAP ASE System. + public partial class AzureVMWorkloadSapAseSystemProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseSystemProtectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseSystemProtectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName = value ?? null; } + + /// Indicates if protectable item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable = value ?? default(bool); } + + /// Indicates if protectable item is auto-protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtected { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentUniqueName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName = value ?? null; } + + /// Pre-backup validation for protectable objects + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation Prebackupvalidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation = value ?? null /* model class */; } + + /// Error code of protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode = value ?? null; } + + /// Message corresponding to the error code for the protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage = value ?? null; } + + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? PrebackupvalidationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus)""); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subprotectableitemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount = value ?? default(int); } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSapAseSystemProtectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + } + } + /// Azure VM workload-specific protectable item representing SAP ASE System. + public partial interface IAzureVMWorkloadSapAseSystemProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem + { + + } + /// Azure VM workload-specific protectable item representing SAP ASE System. + internal partial interface IAzureVMWorkloadSapAseSystemProtectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemProtectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemProtectableItem.json.cs new file mode 100644 index 000000000000..9f1a613759d8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemProtectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item representing SAP ASE System. + public partial class AzureVMWorkloadSapAseSystemProtectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSapAseSystemProtectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseSystemProtectableItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseSystemProtectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseSystemProtectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSapAseSystemProtectableItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadProtectableItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemWorkloadItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemWorkloadItem.cs new file mode 100644 index 000000000000..991ef55f6829 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemWorkloadItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SAP ASE System. + public partial class AzureVMWorkloadSapAseSystemWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseSystemWorkloadItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseSystemWorkloadItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName = value ?? null; } + + /// Indicates if workload item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName = value ?? null; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? SubWorkloadItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount = value ?? default(int); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type = value ; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType = value ?? null; } + + /// Creates an new instance. + public AzureVMWorkloadSapAseSystemWorkloadItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + } + } + /// Azure VM workload-specific workload item representing SAP ASE System. + public partial interface IAzureVMWorkloadSapAseSystemWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem + { + + } + /// Azure VM workload-specific workload item representing SAP ASE System. + internal partial interface IAzureVMWorkloadSapAseSystemWorkloadItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemWorkloadItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemWorkloadItem.json.cs new file mode 100644 index 000000000000..704d0b06a704 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapAseSystemWorkloadItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SAP ASE System. + public partial class AzureVMWorkloadSapAseSystemWorkloadItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSapAseSystemWorkloadItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseSystemWorkloadItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseSystemWorkloadItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapAseSystemWorkloadItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSapAseSystemWorkloadItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectableItem.cs new file mode 100644 index 000000000000..de7a7c00c38a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectableItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item representing SAP HANA Database. + public partial class AzureVMWorkloadSapHanaDatabaseProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseProtectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseProtectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName = value ?? null; } + + /// Indicates if protectable item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable = value ?? default(bool); } + + /// Indicates if protectable item is auto-protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtected { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentUniqueName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName = value ?? null; } + + /// Pre-backup validation for protectable objects + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation Prebackupvalidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation = value ?? null /* model class */; } + + /// Error code of protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode = value ?? null; } + + /// Message corresponding to the error code for the protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage = value ?? null; } + + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? PrebackupvalidationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus)""); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subprotectableitemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount = value ?? default(int); } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSapHanaDatabaseProtectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + } + } + /// Azure VM workload-specific protectable item representing SAP HANA Database. + public partial interface IAzureVMWorkloadSapHanaDatabaseProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem + { + + } + /// Azure VM workload-specific protectable item representing SAP HANA Database. + internal partial interface IAzureVMWorkloadSapHanaDatabaseProtectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectableItem.json.cs new file mode 100644 index 000000000000..9a6893733b28 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item representing SAP HANA Database. + public partial class AzureVMWorkloadSapHanaDatabaseProtectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSapHanaDatabaseProtectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseProtectableItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseProtectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseProtectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSapHanaDatabaseProtectableItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadProtectableItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectedItem.cs new file mode 100644 index 000000000000..558d364ca6a8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectedItem.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protected item representing SAP HANA Database. + public partial class AzureVMWorkloadSapHanaDatabaseProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem __azureVMWorkloadProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Additional information for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo = value ?? null /* model class */; } + + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoNewestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoNewestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInVault = value ?? default(global::System.DateTime); } + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedInfoPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState = value ?? null; } + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedInfoRecoveryModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryModel; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryModel = value ?? null; } + + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryPointCount = value ?? default(int); } + + /// Friendly name of the DB represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName = value ?? null; } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).KpisHealth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).KpisHealth = value ?? null /* model class */; } + + /// Error details in last backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail LastBackupErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetail = value ?? null /* model class */; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation; } + + /// Last backup operation status. Possible values: Healthy, Unhealthy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus? LastBackupStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus)""); } + + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastBackupTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupTime = value ?? default(global::System.DateTime); } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for LastBackupErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode = value; } + + /// Internal Acessors for LastBackupErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage = value; } + + /// Internal Acessors for LastBackupErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation = value; } + + /// Parent name of the DB such as Instance or Availability Group. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentName = value ?? null; } + + /// + /// Parent type of protected item, example: for a DB, standalone server or distributed + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentType = value ?? null; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyName = value ?? null; } + + /// Data ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectedItemDataSourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemDataSourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemDataSourceId = value ?? null; } + + /// Health status of the backup item, evaluated based on last heartbeat received + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus? ProtectedItemHealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemHealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemHealthStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus)""); } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState)""); } + + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionStatus = value ?? null; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ServerName = value ?? null; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).Type = value ; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSapHanaDatabaseProtectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadProtectedItem), __azureVMWorkloadProtectedItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadProtectedItem), __azureVMWorkloadProtectedItem); + } + } + /// Azure VM workload-specific protected item representing SAP HANA Database. + public partial interface IAzureVMWorkloadSapHanaDatabaseProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem + { + + } + /// Azure VM workload-specific protected item representing SAP HANA Database. + internal partial interface IAzureVMWorkloadSapHanaDatabaseProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectedItem.json.cs new file mode 100644 index 000000000000..176336f97d85 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseProtectedItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protected item representing SAP HANA Database. + public partial class AzureVMWorkloadSapHanaDatabaseProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSapHanaDatabaseProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSapHanaDatabaseProtectedItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadProtectedItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseWorkloadItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseWorkloadItem.cs new file mode 100644 index 000000000000..b67e975587eb --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseWorkloadItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SAP HANA Database. + public partial class AzureVMWorkloadSapHanaDatabaseWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseWorkloadItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseWorkloadItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName = value ?? null; } + + /// Indicates if workload item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName = value ?? null; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? SubWorkloadItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount = value ?? default(int); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type = value ; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSapHanaDatabaseWorkloadItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + } + } + /// Azure VM workload-specific workload item representing SAP HANA Database. + public partial interface IAzureVMWorkloadSapHanaDatabaseWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem + { + + } + /// Azure VM workload-specific workload item representing SAP HANA Database. + internal partial interface IAzureVMWorkloadSapHanaDatabaseWorkloadItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseWorkloadItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseWorkloadItem.json.cs new file mode 100644 index 000000000000..c63c822b02db --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaDatabaseWorkloadItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SAP HANA Database. + public partial class AzureVMWorkloadSapHanaDatabaseWorkloadItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSapHanaDatabaseWorkloadItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseWorkloadItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseWorkloadItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaDatabaseWorkloadItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSapHanaDatabaseWorkloadItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemProtectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemProtectableItem.cs new file mode 100644 index 000000000000..2b7b7f47ce49 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemProtectableItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item representing SAP HANA System. + public partial class AzureVMWorkloadSapHanaSystemProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaSystemProtectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaSystemProtectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName = value ?? null; } + + /// Indicates if protectable item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable = value ?? default(bool); } + + /// Indicates if protectable item is auto-protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtected { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentUniqueName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName = value ?? null; } + + /// Pre-backup validation for protectable objects + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation Prebackupvalidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation = value ?? null /* model class */; } + + /// Error code of protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode = value ?? null; } + + /// Message corresponding to the error code for the protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage = value ?? null; } + + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? PrebackupvalidationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus)""); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subprotectableitemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount = value ?? default(int); } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSapHanaSystemProtectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + } + } + /// Azure VM workload-specific protectable item representing SAP HANA System. + public partial interface IAzureVMWorkloadSapHanaSystemProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem + { + + } + /// Azure VM workload-specific protectable item representing SAP HANA System. + internal partial interface IAzureVMWorkloadSapHanaSystemProtectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemProtectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemProtectableItem.json.cs new file mode 100644 index 000000000000..3ddc5ceb01b6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemProtectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item representing SAP HANA System. + public partial class AzureVMWorkloadSapHanaSystemProtectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSapHanaSystemProtectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaSystemProtectableItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaSystemProtectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaSystemProtectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSapHanaSystemProtectableItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadProtectableItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemWorkloadItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemWorkloadItem.cs new file mode 100644 index 000000000000..55e7901cfba3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemWorkloadItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SAP HANA System. + public partial class AzureVMWorkloadSapHanaSystemWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaSystemWorkloadItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaSystemWorkloadItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName = value ?? null; } + + /// Indicates if workload item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName = value ?? null; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? SubWorkloadItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount = value ?? default(int); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type = value ; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSapHanaSystemWorkloadItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + } + } + /// Azure VM workload-specific workload item representing SAP HANA System. + public partial interface IAzureVMWorkloadSapHanaSystemWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem + { + + } + /// Azure VM workload-specific workload item representing SAP HANA System. + internal partial interface IAzureVMWorkloadSapHanaSystemWorkloadItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemWorkloadItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemWorkloadItem.json.cs new file mode 100644 index 000000000000..2dd1fde8bdae --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSapHanaSystemWorkloadItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SAP HANA System. + public partial class AzureVMWorkloadSapHanaSystemWorkloadItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSapHanaSystemWorkloadItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaSystemWorkloadItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaSystemWorkloadItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSapHanaSystemWorkloadItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSapHanaSystemWorkloadItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlAvailabilityGroupProtectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlAvailabilityGroupProtectableItem.cs new file mode 100644 index 000000000000..9749b7b5800d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlAvailabilityGroupProtectableItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Azure VM workload-specific protectable item representing SQL Availability Group. + /// + public partial class AzureVMWorkloadSqlAvailabilityGroupProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlAvailabilityGroupProtectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlAvailabilityGroupProtectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName = value ?? null; } + + /// Indicates if protectable item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable = value ?? default(bool); } + + /// Indicates if protectable item is auto-protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtected { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentUniqueName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName = value ?? null; } + + /// Pre-backup validation for protectable objects + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation Prebackupvalidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation = value ?? null /* model class */; } + + /// Error code of protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode = value ?? null; } + + /// Message corresponding to the error code for the protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage = value ?? null; } + + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? PrebackupvalidationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus)""); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subprotectableitemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount = value ?? default(int); } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSqlAvailabilityGroupProtectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + } + } + /// Azure VM workload-specific protectable item representing SQL Availability Group. + public partial interface IAzureVMWorkloadSqlAvailabilityGroupProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem + { + + } + /// Azure VM workload-specific protectable item representing SQL Availability Group. + internal partial interface IAzureVMWorkloadSqlAvailabilityGroupProtectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlAvailabilityGroupProtectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlAvailabilityGroupProtectableItem.json.cs new file mode 100644 index 000000000000..c49b98dca655 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlAvailabilityGroupProtectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Azure VM workload-specific protectable item representing SQL Availability Group. + /// + public partial class AzureVMWorkloadSqlAvailabilityGroupProtectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSqlAvailabilityGroupProtectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlAvailabilityGroupProtectableItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlAvailabilityGroupProtectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlAvailabilityGroupProtectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSqlAvailabilityGroupProtectableItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadProtectableItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectableItem.cs new file mode 100644 index 000000000000..413b50509e8d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectableItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item representing SQL Database. + public partial class AzureVMWorkloadSqlDatabaseProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseProtectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseProtectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName = value ?? null; } + + /// Indicates if protectable item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable = value ?? default(bool); } + + /// Indicates if protectable item is auto-protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtected { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentUniqueName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName = value ?? null; } + + /// Pre-backup validation for protectable objects + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation Prebackupvalidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation = value ?? null /* model class */; } + + /// Error code of protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode = value ?? null; } + + /// Message corresponding to the error code for the protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage = value ?? null; } + + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? PrebackupvalidationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus)""); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subprotectableitemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount = value ?? default(int); } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSqlDatabaseProtectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + } + } + /// Azure VM workload-specific protectable item representing SQL Database. + public partial interface IAzureVMWorkloadSqlDatabaseProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem + { + + } + /// Azure VM workload-specific protectable item representing SQL Database. + internal partial interface IAzureVMWorkloadSqlDatabaseProtectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectableItem.json.cs new file mode 100644 index 000000000000..bf898fd25ea3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item representing SQL Database. + public partial class AzureVMWorkloadSqlDatabaseProtectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSqlDatabaseProtectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseProtectableItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseProtectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseProtectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSqlDatabaseProtectableItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadProtectableItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectedItem.cs new file mode 100644 index 000000000000..b397599d31a2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectedItem.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protected item representing SQL Database. + public partial class AzureVMWorkloadSqlDatabaseProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem __azureVMWorkloadProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Additional information for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo = value ?? null /* model class */; } + + /// The latest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoNewestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoNewestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoNewestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item across all tiers. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in archive tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInArchive = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available for this backup item in vault tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPointInVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPointInVault = value ?? default(global::System.DateTime); } + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedInfoPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState = value ?? null; } + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedInfoRecoveryModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryModel; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryModel = value ?? null; } + + /// Number of backup copies available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryPointCount = value ?? default(int); } + + /// Friendly name of the DB represented by this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName = value ?? null; } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Health details of different KPIs + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).KpisHealth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).KpisHealth = value ?? null /* model class */; } + + /// Error details in last backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail LastBackupErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetail = value ?? null /* model class */; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation; } + + /// Last backup operation status. Possible values: Healthy, Unhealthy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus? LastBackupStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus)""); } + + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastBackupTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupTime = value ?? default(global::System.DateTime); } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for LastBackupErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode = value; } + + /// Internal Acessors for LastBackupErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage = value; } + + /// Internal Acessors for LastBackupErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation = value; } + + /// Parent name of the DB such as Instance or Availability Group. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentName = value ?? null; } + + /// + /// Parent type of protected item, example: for a DB, standalone server or distributed + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentType = value ?? null; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyName = value ?? null; } + + /// Data ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectedItemDataSourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemDataSourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemDataSourceId = value ?? null; } + + /// Health status of the backup item, evaluated based on last heartbeat received + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus? ProtectedItemHealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemHealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemHealthStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus)""); } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState)""); } + + /// Backup status of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionStatus = value ?? null; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ServerName = value ?? null; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).Type = value ; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__azureVMWorkloadProtectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public AzureVMWorkloadSqlDatabaseProtectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadProtectedItem), __azureVMWorkloadProtectedItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadProtectedItem), __azureVMWorkloadProtectedItem); + } + } + /// Azure VM workload-specific protected item representing SQL Database. + public partial interface IAzureVMWorkloadSqlDatabaseProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItem + { + + } + /// Azure VM workload-specific protected item representing SQL Database. + internal partial interface IAzureVMWorkloadSqlDatabaseProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectedItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectedItem.json.cs new file mode 100644 index 000000000000..2053d2185d01 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseProtectedItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protected item representing SQL Database. + public partial class AzureVMWorkloadSqlDatabaseProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSqlDatabaseProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectedItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSqlDatabaseProtectedItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadProtectedItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseWorkloadItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseWorkloadItem.cs new file mode 100644 index 000000000000..0efd8ee885b5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseWorkloadItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SQL Database. + public partial class AzureVMWorkloadSqlDatabaseWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseWorkloadItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseWorkloadItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName = value ?? null; } + + /// Indicates if workload item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName = value ?? null; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? SubWorkloadItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount = value ?? default(int); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type = value ; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType = value ?? null; } + + /// Creates an new instance. + public AzureVMWorkloadSqlDatabaseWorkloadItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + } + } + /// Azure VM workload-specific workload item representing SQL Database. + public partial interface IAzureVMWorkloadSqlDatabaseWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem + { + + } + /// Azure VM workload-specific workload item representing SQL Database. + internal partial interface IAzureVMWorkloadSqlDatabaseWorkloadItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseWorkloadItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseWorkloadItem.json.cs new file mode 100644 index 000000000000..0eb308f99ee7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlDatabaseWorkloadItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SQL Database. + public partial class AzureVMWorkloadSqlDatabaseWorkloadItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSqlDatabaseWorkloadItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseWorkloadItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseWorkloadItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlDatabaseWorkloadItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSqlDatabaseWorkloadItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceProtectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceProtectableItem.cs new file mode 100644 index 000000000000..42abe18e82cb --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceProtectableItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item representing SQL Instance. + public partial class AzureVMWorkloadSqlInstanceProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlInstanceProtectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlInstanceProtectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).FriendlyName = value ?? null; } + + /// Indicates if protectable item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtectable = value ?? default(bool); } + + /// Indicates if protectable item is auto-protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtected { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).IsAutoProtected = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentName = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentUniqueName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ParentUniqueName = value ?? null; } + + /// Pre-backup validation for protectable objects + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation Prebackupvalidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Prebackupvalidation = value ?? null /* model class */; } + + /// Error code of protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationCode = value ?? null; } + + /// Message corresponding to the error code for the protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PrebackupvalidationMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationMessage = value ?? null; } + + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? PrebackupvalidationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).PrebackupvalidationStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus)""); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subinquireditemcount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subprotectableitemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).Subprotectableitemcount = value ?? default(int); } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__azureVMWorkloadProtectableItem).WorkloadType = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureVMWorkloadSqlInstanceProtectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadProtectableItem), __azureVMWorkloadProtectableItem); + } + } + /// Azure VM workload-specific protectable item representing SQL Instance. + public partial interface IAzureVMWorkloadSqlInstanceProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItem + { + + } + /// Azure VM workload-specific protectable item representing SQL Instance. + internal partial interface IAzureVMWorkloadSqlInstanceProtectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadProtectableItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceProtectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceProtectableItem.json.cs new file mode 100644 index 000000000000..cfe95771d4ba --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceProtectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific protectable item representing SQL Instance. + public partial class AzureVMWorkloadSqlInstanceProtectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSqlInstanceProtectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadProtectableItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlInstanceProtectableItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlInstanceProtectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlInstanceProtectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSqlInstanceProtectableItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadProtectableItem?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceWorkloadItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceWorkloadItem.cs new file mode 100644 index 000000000000..67c858868722 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceWorkloadItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SQL Instance. + public partial class AzureVMWorkloadSqlInstanceWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlInstanceWorkloadItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlInstanceWorkloadItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).BackupManagementType = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] _dataDirectoryPath; + + /// Data Directory Paths for default directories + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] DataDirectoryPath { get => this._dataDirectoryPath; set => this._dataDirectoryPath = value; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).FriendlyName = value ?? null; } + + /// Indicates if workload item is auto-protectable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAutoProtectable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).IsAutoProtectable = value ?? default(bool); } + + /// Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ParentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ParentName = value ?? null; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Host/Cluster Name for instance or AG + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).ServerName = value ?? null; } + + /// For instance or AG, indicates number of DB's to be protected + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? SubWorkloadItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).SubWorkloadItemCount = value ?? default(int); } + + /// For instance or AG, indicates number of DB's present + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? Subinquireditemcount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal)__azureVMWorkloadItem).Subinquireditemcount = value ?? default(int); } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).Type = value ; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)__azureVMWorkloadItem).WorkloadType = value ?? null; } + + /// Creates an new instance. + public AzureVMWorkloadSqlInstanceWorkloadItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + await eventListener.AssertObjectIsValid(nameof(__azureVMWorkloadItem), __azureVMWorkloadItem); + } + } + /// Azure VM workload-specific workload item representing SQL Instance. + public partial interface IAzureVMWorkloadSqlInstanceWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItem + { + /// Data Directory Paths for default directories + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Directory Paths for default directories", + SerializedName = @"dataDirectoryPaths", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] DataDirectoryPath { get; set; } + + } + /// Azure VM workload-specific workload item representing SQL Instance. + internal partial interface IAzureVMWorkloadSqlInstanceWorkloadItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadItemInternal + { + /// Data Directory Paths for default directories + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] DataDirectoryPath { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceWorkloadItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceWorkloadItem.json.cs new file mode 100644 index 000000000000..2ac7489f0c73 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureVMWorkloadSqlInstanceWorkloadItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific workload item representing SQL Instance. + public partial class AzureVMWorkloadSqlInstanceWorkloadItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureVMWorkloadSqlInstanceWorkloadItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureVMWorkloadItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMWorkloadItem(json); + {_dataDirectoryPath = If( json?.PropertyT("dataDirectoryPaths"), out var __jsonDataDirectoryPaths) ? If( __jsonDataDirectoryPaths as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SqlDataDirectory.FromJson(__u) )) ))() : null : DataDirectoryPath;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlInstanceWorkloadItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlInstanceWorkloadItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureVMWorkloadSqlInstanceWorkloadItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureVMWorkloadSqlInstanceWorkloadItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureVMWorkloadItem?.ToJson(container, serializationMode); + if (null != this._dataDirectoryPath) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._dataDirectoryPath ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("dataDirectoryPaths",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadAutoProtectionIntent.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadAutoProtectionIntent.cs new file mode 100644 index 000000000000..570359d1ec7a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadAutoProtectionIntent.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Recovery Services Vault specific protection intent item. + public partial class AzureWorkloadAutoProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadAutoProtectionIntent, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadAutoProtectionIntentInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent __protectionIntent = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ItemId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemId = value ?? null; } + + /// backup protectionIntent type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType ItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemType = value ; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).PolicyId = value ?? null; } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).SourceResourceId = value ?? null; } + + /// Creates an new instance. + public AzureWorkloadAutoProtectionIntent() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionIntent), __protectionIntent); + await eventListener.AssertObjectIsValid(nameof(__protectionIntent), __protectionIntent); + } + } + /// Azure Recovery Services Vault specific protection intent item. + public partial interface IAzureWorkloadAutoProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent + { + + } + /// Azure Recovery Services Vault specific protection intent item. + internal partial interface IAzureWorkloadAutoProtectionIntentInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadAutoProtectionIntent.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadAutoProtectionIntent.json.cs new file mode 100644 index 000000000000..a92c356bfbad --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadAutoProtectionIntent.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Recovery Services Vault specific protection intent item. + public partial class AzureWorkloadAutoProtectionIntent + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadAutoProtectionIntent(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionIntent = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadAutoProtectionIntent. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadAutoProtectionIntent. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadAutoProtectionIntent FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadAutoProtectionIntent(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionIntent?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadBackupRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadBackupRequest.cs new file mode 100644 index 000000000000..4f48d56f236a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadBackupRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload workload-specific backup request. + public partial class AzureWorkloadBackupRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadBackupRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadBackupRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest __backupRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupRequest(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType? _backupType; + + /// Type of backup, viz. Full, Differential, Log or CopyOnlyFull + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType? BackupType { get => this._backupType; set => this._backupType = value; } + + /// Backing field for property. + private bool? _enableCompression; + + /// Bool for Compression setting + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? EnableCompression { get => this._enableCompression; set => this._enableCompression = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal)__backupRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal)__backupRequest).ObjectType = value ; } + + /// Backing field for property. + private global::System.DateTime? _recoveryPointExpiryTimeInUtc; + + /// Backup copy will expire after the time specified (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? RecoveryPointExpiryTimeInUtc { get => this._recoveryPointExpiryTimeInUtc; set => this._recoveryPointExpiryTimeInUtc = value; } + + /// Creates an new instance. + public AzureWorkloadBackupRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__backupRequest), __backupRequest); + await eventListener.AssertObjectIsValid(nameof(__backupRequest), __backupRequest); + } + } + /// AzureWorkload workload-specific backup request. + public partial interface IAzureWorkloadBackupRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest + { + /// Type of backup, viz. Full, Differential, Log or CopyOnlyFull + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup, viz. Full, Differential, Log or CopyOnlyFull", + SerializedName = @"backupType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType? BackupType { get; set; } + /// Bool for Compression setting + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Bool for Compression setting", + SerializedName = @"enableCompression", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableCompression { get; set; } + /// Backup copy will expire after the time specified (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup copy will expire after the time specified (UTC).", + SerializedName = @"recoveryPointExpiryTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecoveryPointExpiryTimeInUtc { get; set; } + + } + /// AzureWorkload workload-specific backup request. + internal partial interface IAzureWorkloadBackupRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal + { + /// Type of backup, viz. Full, Differential, Log or CopyOnlyFull + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType? BackupType { get; set; } + /// Bool for Compression setting + bool? EnableCompression { get; set; } + /// Backup copy will expire after the time specified (UTC). + global::System.DateTime? RecoveryPointExpiryTimeInUtc { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadBackupRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadBackupRequest.json.cs new file mode 100644 index 000000000000..8ddb06c1cb71 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadBackupRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload workload-specific backup request. + public partial class AzureWorkloadBackupRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadBackupRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __backupRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupRequest(json); + {_backupType = If( json?.PropertyT("backupType"), out var __jsonBackupType) ? (string)__jsonBackupType : (string)BackupType;} + {_enableCompression = If( json?.PropertyT("enableCompression"), out var __jsonEnableCompression) ? (bool?)__jsonEnableCompression : EnableCompression;} + {_recoveryPointExpiryTimeInUtc = If( json?.PropertyT("recoveryPointExpiryTimeInUTC"), out var __jsonRecoveryPointExpiryTimeInUtc) ? global::System.DateTime.TryParse((string)__jsonRecoveryPointExpiryTimeInUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRecoveryPointExpiryTimeInUtcValue) ? __jsonRecoveryPointExpiryTimeInUtcValue : RecoveryPointExpiryTimeInUtc : RecoveryPointExpiryTimeInUtc;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadBackupRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadBackupRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadBackupRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadBackupRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __backupRequest?.ToJson(container, serializationMode); + AddIf( null != (((object)this._backupType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupType.ToString()) : null, "backupType" ,container.Add ); + AddIf( null != this._enableCompression ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._enableCompression) : null, "enableCompression" ,container.Add ); + AddIf( null != this._recoveryPointExpiryTimeInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointExpiryTimeInUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "recoveryPointExpiryTimeInUTC" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainer.cs new file mode 100644 index 000000000000..e71455886983 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainer.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container for the workloads running inside Azure Compute or Classic Compute. + public partial class AzureWorkloadContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType = value ; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).ErrorDetailCode; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).ErrorDetailMessage; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).ErrorDetailRecommendation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfo _extendedInfo; + + /// Additional details of a workload container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadContainerExtendedInfo()); set => this._extendedInfo = value; } + + /// + /// Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoHostServerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).HostServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).HostServerName = value ?? null; } + + /// List of the nodes in case of distributed container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo[] ExtendedInfoNodesList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).NodesList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).NodesList = value ?? null /* arrayOf */; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus = value ?? null; } + + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryInfoInquiryDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).InquiryInfoInquiryDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).InquiryInfoInquiryDetail = value ?? null /* arrayOf */; } + + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string InquiryInfoStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).InquiryInfoStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).InquiryInfoStatus = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _lastUpdatedTime; + + /// Time stamp when this container was updated. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? LastUpdatedTime { get => this._lastUpdatedTime; set => this._lastUpdatedTime = value; } + + /// Internal Acessors for ErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).ErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).ErrorDetailCode = value; } + + /// Internal Acessors for ErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).ErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).ErrorDetailMessage = value; } + + /// Internal Acessors for ErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).ErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).ErrorDetailRecommendation = value; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadContainerExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Internal Acessors for ExtendedInfoInquiryInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.ExtendedInfoInquiryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).InquiryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).InquiryInfo = value; } + + /// Internal Acessors for InquiryInfoErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerInternal.InquiryInfoErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).InquiryInfoErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal)ExtendedInfo).InquiryInfoErrorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType? _operationType; + + /// Re-Do Operation + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType? OperationType { get => this._operationType; set => this._operationType = value; } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType = value ?? null; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus = value ?? null; } + + /// Backing field for property. + private string _sourceResourceId; + + /// ARM ID of the virtual machine represented by this Azure Workload Container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? _workloadType; + + /// Workload type for which registration was sent. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public AzureWorkloadContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionContainer), __protectionContainer); + await eventListener.AssertObjectIsValid(nameof(__protectionContainer), __protectionContainer); + } + } + /// Container for the workloads running inside Azure Compute or Classic Compute. + public partial interface IAzureWorkloadContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailCode { get; } + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message related to the Code.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailMessage { get; } + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of recommendation strings.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] ErrorDetailRecommendation { get; } + /// + /// Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host Os Name in case of Stand Alone and Cluster Name in case of distributed container.", + SerializedName = @"hostServerName", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoHostServerName { get; set; } + /// List of the nodes in case of distributed container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of the nodes in case of distributed container.", + SerializedName = @"nodesList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo[] ExtendedInfoNodesList { get; set; } + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Inquiry Details which will have workload specific details. + For e.g. - For SQL and oracle this will contain different details.", + SerializedName = @"inquiryDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryInfoInquiryDetail { get; set; } + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Inquiry Status for this container such as + InProgress | Failed | Succeeded", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string InquiryInfoStatus { get; set; } + /// Time stamp when this container was updated. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time stamp when this container was updated.", + SerializedName = @"lastUpdatedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastUpdatedTime { get; set; } + /// Re-Do Operation + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Re-Do Operation", + SerializedName = @"operationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType? OperationType { get; set; } + /// ARM ID of the virtual machine represented by this Azure Workload Container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the virtual machine represented by this Azure Workload Container", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + /// Workload type for which registration was sent. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload type for which registration was sent.", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } + /// Container for the workloads running inside Azure Compute or Classic Compute. + internal partial interface IAzureWorkloadContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal + { + /// Error code. + string ErrorDetailCode { get; set; } + /// Error Message related to the Code. + string ErrorDetailMessage { get; set; } + /// List of recommendation strings. + string[] ErrorDetailRecommendation { get; set; } + /// Additional details of a workload container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfo ExtendedInfo { get; set; } + /// + /// Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + /// + string ExtendedInfoHostServerName { get; set; } + /// Inquiry Status for the container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo ExtendedInfoInquiryInfo { get; set; } + /// List of the nodes in case of distributed container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo[] ExtendedInfoNodesList { get; set; } + /// Error Details if the Status is non-success. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail InquiryInfoErrorDetail { get; set; } + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryInfoInquiryDetail { get; set; } + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + string InquiryInfoStatus { get; set; } + /// Time stamp when this container was updated. + global::System.DateTime? LastUpdatedTime { get; set; } + /// Re-Do Operation + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType? OperationType { get; set; } + /// ARM ID of the virtual machine represented by this Azure Workload Container + string SourceResourceId { get; set; } + /// Workload type for which registration was sent. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainer.json.cs new file mode 100644 index 000000000000..b1a94307e8f7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainer.json.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container for the workloads running inside Azure Compute or Classic Compute. + public partial class AzureWorkloadContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadContainerExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + {_lastUpdatedTime = If( json?.PropertyT("lastUpdatedTime"), out var __jsonLastUpdatedTime) ? global::System.DateTime.TryParse((string)__jsonLastUpdatedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastUpdatedTimeValue) ? __jsonLastUpdatedTimeValue : LastUpdatedTime : LastUpdatedTime;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + {_operationType = If( json?.PropertyT("operationType"), out var __jsonOperationType) ? (string)__jsonOperationType : (string)OperationType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainer. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainer interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("containerType") ) + { + case "SQLAGWorkLoadContainer": + { + return new AzureSqlagWorkloadContainerProtectionContainer(json); + } + case "VMAppContainer": + { + return new AzureVMAppContainerProtectionContainer(json); + } + } + return new AzureWorkloadContainer(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionContainer?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + AddIf( null != this._lastUpdatedTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastUpdatedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastUpdatedTime" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + AddIf( null != (((object)this._operationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._operationType.ToString()) : null, "operationType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerAutoProtectionIntent.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerAutoProtectionIntent.cs new file mode 100644 index 000000000000..8a4970d75027 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerAutoProtectionIntent.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure workload specific protection intent item. + public partial class AzureWorkloadContainerAutoProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerAutoProtectionIntent, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerAutoProtectionIntentInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent __protectionIntent = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ItemId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemId = value ?? null; } + + /// backup protectionIntent type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType ItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ItemType = value ; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).PolicyId = value ?? null; } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__protectionIntent).SourceResourceId = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureWorkloadContainerAutoProtectionIntent() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionIntent), __protectionIntent); + await eventListener.AssertObjectIsValid(nameof(__protectionIntent), __protectionIntent); + } + } + /// Azure workload specific protection intent item. + public partial interface IAzureWorkloadContainerAutoProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent + { + + } + /// Azure workload specific protection intent item. + internal partial interface IAzureWorkloadContainerAutoProtectionIntentInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerAutoProtectionIntent.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerAutoProtectionIntent.json.cs new file mode 100644 index 000000000000..af354f981ea6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerAutoProtectionIntent.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure workload specific protection intent item. + public partial class AzureWorkloadContainerAutoProtectionIntent + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadContainerAutoProtectionIntent(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionIntent = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerAutoProtectionIntent. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerAutoProtectionIntent. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerAutoProtectionIntent FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadContainerAutoProtectionIntent(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionIntent?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerExtendedInfo.cs new file mode 100644 index 000000000000..61687834413c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerExtendedInfo.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Extended information of the container. + public partial class AzureWorkloadContainerExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetailCode; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetailMessage; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetailRecommendation; } + + /// Backing field for property. + private string _hostServerName; + + /// + /// Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string HostServerName { get => this._hostServerName; set => this._hostServerName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo _inquiryInfo; + + /// Inquiry Status for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo InquiryInfo { get => (this._inquiryInfo = this._inquiryInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InquiryInfo()); set => this._inquiryInfo = value; } + + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryInfoInquiryDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).InquiryDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).InquiryDetail = value ?? null /* arrayOf */; } + + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string InquiryInfoStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).Status = value ?? null; } + + /// Internal Acessors for ErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal.ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetailCode = value; } + + /// Internal Acessors for ErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal.ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetailMessage = value; } + + /// Internal Acessors for ErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal.ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetailRecommendation = value; } + + /// Internal Acessors for InquiryInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal.InquiryInfo { get => (this._inquiryInfo = this._inquiryInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InquiryInfo()); set { {_inquiryInfo = value;} } } + + /// Internal Acessors for InquiryInfoErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfoInternal.InquiryInfoErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal)InquiryInfo).ErrorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo[] _nodesList; + + /// List of the nodes in case of distributed container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo[] NodesList { get => this._nodesList; set => this._nodesList = value; } + + /// Creates an new instance. + public AzureWorkloadContainerExtendedInfo() + { + + } + } + /// Extended information of the container. + public partial interface IAzureWorkloadContainerExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailCode { get; } + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message related to the Code.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailMessage { get; } + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of recommendation strings.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] ErrorDetailRecommendation { get; } + /// + /// Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host Os Name in case of Stand Alone and Cluster Name in case of distributed container.", + SerializedName = @"hostServerName", + PossibleTypes = new [] { typeof(string) })] + string HostServerName { get; set; } + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Inquiry Details which will have workload specific details. + For e.g. - For SQL and oracle this will contain different details.", + SerializedName = @"inquiryDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryInfoInquiryDetail { get; set; } + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Inquiry Status for this container such as + InProgress | Failed | Succeeded", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string InquiryInfoStatus { get; set; } + /// List of the nodes in case of distributed container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of the nodes in case of distributed container.", + SerializedName = @"nodesList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo[] NodesList { get; set; } + + } + /// Extended information of the container. + internal partial interface IAzureWorkloadContainerExtendedInfoInternal + + { + /// Error code. + string ErrorDetailCode { get; set; } + /// Error Message related to the Code. + string ErrorDetailMessage { get; set; } + /// List of recommendation strings. + string[] ErrorDetailRecommendation { get; set; } + /// + /// Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + /// + string HostServerName { get; set; } + /// Inquiry Status for the container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo InquiryInfo { get; set; } + /// Error Details if the Status is non-success. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail InquiryInfoErrorDetail { get; set; } + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryInfoInquiryDetail { get; set; } + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + string InquiryInfoStatus { get; set; } + /// List of the nodes in case of distributed container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo[] NodesList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerExtendedInfo.json.cs new file mode 100644 index 000000000000..3767eddc1e74 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadContainerExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Extended information of the container. + public partial class AzureWorkloadContainerExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadContainerExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_inquiryInfo = If( json?.PropertyT("inquiryInfo"), out var __jsonInquiryInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InquiryInfo.FromJson(__jsonInquiryInfo) : InquiryInfo;} + {_hostServerName = If( json?.PropertyT("hostServerName"), out var __jsonHostServerName) ? (string)__jsonHostServerName : (string)HostServerName;} + {_nodesList = If( json?.PropertyT("nodesList"), out var __jsonNodesList) ? If( __jsonNodesList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DistributedNodesInfo.FromJson(__u) )) ))() : null : NodesList;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadContainerExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadContainerExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._inquiryInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._inquiryInfo.ToJson(null,serializationMode) : null, "inquiryInfo" ,container.Add ); + AddIf( null != (((object)this._hostServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._hostServerName.ToString()) : null, "hostServerName" ,container.Add ); + if (null != this._nodesList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._nodesList ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("nodesList",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadErrorInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadErrorInfo.cs new file mode 100644 index 000000000000..1a926bc8a11a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadErrorInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific error information + public partial class AzureWorkloadErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfoInternal + { + + /// Backing field for property. + private string _additionalDetail; + + /// Additional details for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AdditionalDetail { get => this._additionalDetail; set => this._additionalDetail = value; } + + /// Backing field for property. + private int? _errorCode; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? ErrorCode { get => this._errorCode; set => this._errorCode = value; } + + /// Backing field for property. + private string _errorString; + + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorString { get => this._errorString; set => this._errorString = value; } + + /// Backing field for property. + private string _errorTitle; + + /// Title: Typically, the entity that the error pertains to. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorTitle { get => this._errorTitle; set => this._errorTitle = value; } + + /// Backing field for property. + private string[] _recommendation; + + /// List of localized recommendations for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; set => this._recommendation = value; } + + /// Creates an new instance. + public AzureWorkloadErrorInfo() + { + + } + } + /// Azure storage specific error information + public partial interface IAzureWorkloadErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Additional details for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional details for above error code.", + SerializedName = @"additionalDetails", + PossibleTypes = new [] { typeof(string) })] + string AdditionalDetail { get; set; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(int) })] + int? ErrorCode { get; set; } + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Localized error string.", + SerializedName = @"errorString", + PossibleTypes = new [] { typeof(string) })] + string ErrorString { get; set; } + /// Title: Typically, the entity that the error pertains to. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Title: Typically, the entity that the error pertains to.", + SerializedName = @"errorTitle", + PossibleTypes = new [] { typeof(string) })] + string ErrorTitle { get; set; } + /// List of localized recommendations for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of localized recommendations for above error code.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; set; } + + } + /// Azure storage specific error information + internal partial interface IAzureWorkloadErrorInfoInternal + + { + /// Additional details for above error code. + string AdditionalDetail { get; set; } + /// Error code. + int? ErrorCode { get; set; } + /// Localized error string. + string ErrorString { get; set; } + /// Title: Typically, the entity that the error pertains to. + string ErrorTitle { get; set; } + /// List of localized recommendations for above error code. + string[] Recommendation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadErrorInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadErrorInfo.json.cs new file mode 100644 index 000000000000..8cd5e921306f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadErrorInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific error information + public partial class AzureWorkloadErrorInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadErrorInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (int?)__jsonErrorCode : ErrorCode;} + {_errorString = If( json?.PropertyT("errorString"), out var __jsonErrorString) ? (string)__jsonErrorString : (string)ErrorString;} + {_errorTitle = If( json?.PropertyT("errorTitle"), out var __jsonErrorTitle) ? (string)__jsonErrorTitle : (string)ErrorTitle;} + {_recommendation = If( json?.PropertyT("recommendations"), out var __jsonRecommendations) ? If( __jsonRecommendations as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Recommendation;} + {_additionalDetail = If( json?.PropertyT("additionalDetails"), out var __jsonAdditionalDetails) ? (string)__jsonAdditionalDetails : (string)AdditionalDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadErrorInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._errorCode ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._errorCode) : null, "errorCode" ,container.Add ); + AddIf( null != (((object)this._errorString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorString.ToString()) : null, "errorString" ,container.Add ); + AddIf( null != (((object)this._errorTitle)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorTitle.ToString()) : null, "errorTitle" ,container.Add ); + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + AddIf( null != (((object)this._additionalDetail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._additionalDetail.ToString()) : null, "additionalDetails" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJob.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJob.cs new file mode 100644 index 000000000000..5792fd35ba3c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJob.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific job. + public partial class AzureWorkloadJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] _actionsInfo; + + /// Gets or sets the state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get => this._actionsInfo; set => this._actionsInfo = value; } + + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ActivityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId = value ?? null; } + + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Backing field for property. + private global::System.TimeSpan? _duration; + + /// Time elapsed during the execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.TimeSpan? Duration { get => this._duration; set => this._duration = value; } + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? EndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime = value ?? default(global::System.DateTime); } + + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EntityFriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfo[] _errorDetail; + + /// Error details on execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfo _extendedInfo; + + /// Additional information about the job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadJobExtendedInfo()); set => this._extendedInfo = value; } + + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoDynamicErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage = value ?? null; } + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoInternal)ExtendedInfo).PropertyBag = value ?? null /* model class */; } + + /// List of tasks for this job + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoInternal)ExtendedInfo).TasksList = value ?? null /* arrayOf */; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadJobExtendedInfo()); set { {_extendedInfo = value;} } } + + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Operation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation = value ?? null; } + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime = value ?? default(global::System.DateTime); } + + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status = value ?? null; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type = value ; } + + /// Backing field for property. + private string _workloadType; + + /// Workload type of the job + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public AzureWorkloadJob() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__job), __job); + await eventListener.AssertObjectIsValid(nameof(__job), __job); + } + } + /// Azure storage specific job. + public partial interface IAzureWorkloadJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob + { + /// Gets or sets the state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the state/actions applicable on this job like cancel/retry.", + SerializedName = @"actionsInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Time elapsed during the execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time elapsed during the execution of this job.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Duration { get; set; } + /// Error details on execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error details on execution of this job.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfo[] ErrorDetail { get; set; } + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message on job execution.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoDynamicErrorMessage { get; set; } + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks for this job + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks for this job", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Workload type of the job + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload type of the job", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(string) })] + string WorkloadType { get; set; } + + } + /// Azure storage specific job. + internal partial interface IAzureWorkloadJobInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal + { + /// Gets or sets the state/actions applicable on this job like cancel/retry. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Time elapsed during the execution of this job. + global::System.TimeSpan? Duration { get; set; } + /// Error details on execution of this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfo[] ErrorDetail { get; set; } + /// Additional information about the job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfo ExtendedInfo { get; set; } + /// Non localized error message on job execution. + string ExtendedInfoDynamicErrorMessage { get; set; } + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks for this job + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Workload type of the job + string WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJob.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJob.json.cs new file mode 100644 index 000000000000..cf323c39073e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJob.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific job. + public partial class AzureWorkloadJob + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadJob(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadJobExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonDuration ) : Duration;} + {_actionsInfo = If( json?.PropertyT("actionsInfo"), out var __jsonActionsInfo) ? If( __jsonActionsInfo as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)""))) ))() : null : ActionsInfo;} + {_errorDetail = If( json?.PropertyT("errorDetails"), out var __jsonErrorDetails) ? If( __jsonErrorDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadErrorInfo.FromJson(__p) )) ))() : null : ErrorDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJob FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadJob(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __job?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)(null != this._duration ? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._duration)): null), "duration" ,container.Add ); + if (null != this._actionsInfo) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._actionsInfo ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("actionsInfo",__w); + } + if (null != this._errorDetail) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._errorDetail ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("errorDetails",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfo.cs new file mode 100644 index 000000000000..b4e8a934b948 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific additional information for job. + public partial class AzureWorkloadJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoInternal + { + + /// Backing field for property. + private string _dynamicErrorMessage; + + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DynamicErrorMessage { get => this._dynamicErrorMessage; set => this._dynamicErrorMessage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag _propertyBag; + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails[] _tasksList; + + /// List of tasks for this job + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails[] TasksList { get => this._tasksList; set => this._tasksList = value; } + + /// Creates an new instance. + public AzureWorkloadJobExtendedInfo() + { + + } + } + /// Azure VM workload-specific additional information for job. + public partial interface IAzureWorkloadJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message on job execution.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string DynamicErrorMessage { get; set; } + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks for this job + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks for this job", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails[] TasksList { get; set; } + + } + /// Azure VM workload-specific additional information for job. + internal partial interface IAzureWorkloadJobExtendedInfoInternal + + { + /// Non localized error message on job execution. + string DynamicErrorMessage { get; set; } + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks for this job + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails[] TasksList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfo.json.cs new file mode 100644 index 000000000000..13dbf461a6a8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload-specific additional information for job. + public partial class AzureWorkloadJobExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadJobExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tasksList = If( json?.PropertyT("tasksList"), out var __jsonTasksList) ? If( __jsonTasksList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadJobTaskDetails.FromJson(__u) )) ))() : null : TasksList;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadJobExtendedInfoPropertyBag.FromJson(__jsonPropertyBag) : PropertyBag;} + {_dynamicErrorMessage = If( json?.PropertyT("dynamicErrorMessage"), out var __jsonDynamicErrorMessage) ? (string)__jsonDynamicErrorMessage : (string)DynamicErrorMessage;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadJobExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._tasksList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._tasksList ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("tasksList",__w); + } + AddIf( null != this._propertyBag ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._propertyBag.ToJson(null,serializationMode) : null, "propertyBag" ,container.Add ); + AddIf( null != (((object)this._dynamicErrorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dynamicErrorMessage.ToString()) : null, "dynamicErrorMessage" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..d3670a8df7d7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class AzureWorkloadJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBagInternal + { + + /// Creates an new instance. + public AzureWorkloadJobExtendedInfoPropertyBag() + { + + } + } + /// Job properties. + public partial interface IAzureWorkloadJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Job properties. + internal partial interface IAzureWorkloadJobExtendedInfoPropertyBagInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..fd883a8bd575 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AzureWorkloadJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..133e035a5f65 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobExtendedInfoPropertyBag.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class AzureWorkloadJobExtendedInfoPropertyBag + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureWorkloadJobExtendedInfoPropertyBag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobExtendedInfoPropertyBag FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadJobExtendedInfoPropertyBag(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobTaskDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobTaskDetails.cs new file mode 100644 index 000000000000..5ee3b9123de6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobTaskDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload specific job task details. + public partial class AzureWorkloadJobTaskDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetailsInternal + { + + /// Backing field for property. + private string _status; + + /// The status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string _taskId; + + /// The task display name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Creates an new instance. + public AzureWorkloadJobTaskDetails() + { + + } + } + /// Azure VM workload specific job task details. + public partial interface IAzureWorkloadJobTaskDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + /// The task display name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The task display name.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// Azure VM workload specific job task details. + internal partial interface IAzureWorkloadJobTaskDetailsInternal + + { + /// The status. + string Status { get; set; } + /// The task display name. + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobTaskDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobTaskDetails.json.cs new file mode 100644 index 000000000000..f70bd165c5e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadJobTaskDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM workload specific job task details. + public partial class AzureWorkloadJobTaskDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadJobTaskDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadJobTaskDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadJobTaskDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRecoveryPoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRecoveryPoint.cs new file mode 100644 index 000000000000..16e5d5a5d133 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRecoveryPoint.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point specific to PointInTime + public partial class AzureWorkloadPointInTimeRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint __azureWorkloadRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRecoveryPoint(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__azureWorkloadRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__azureWorkloadRecoveryPoint).ObjectType = value ; } + + /// Eligibility of RP to be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo = value ?? null /* model class */; } + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTierDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTierDetail = value ?? null /* arrayOf */; } + + /// UTC time at which recovery point was created + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? RecoveryPointTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange[] _timeRange; + + /// List of log ranges + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange[] TimeRange { get => this._timeRange; set => this._timeRange = value; } + + /// Type of restore point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType)""); } + + /// Creates an new instance. + public AzureWorkloadPointInTimeRecoveryPoint() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadRecoveryPoint), __azureWorkloadRecoveryPoint); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadRecoveryPoint), __azureWorkloadRecoveryPoint); + } + } + /// Recovery point specific to PointInTime + public partial interface IAzureWorkloadPointInTimeRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint + { + /// List of log ranges + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of log ranges", + SerializedName = @"timeRanges", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange[] TimeRange { get; set; } + + } + /// Recovery point specific to PointInTime + internal partial interface IAzureWorkloadPointInTimeRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal + { + /// List of log ranges + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange[] TimeRange { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRecoveryPoint.json.cs new file mode 100644 index 000000000000..7e58b69f181c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRecoveryPoint.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point specific to PointInTime + public partial class AzureWorkloadPointInTimeRecoveryPoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadPointInTimeRecoveryPoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRecoveryPoint(json); + {_timeRange = If( json?.PropertyT("timeRanges"), out var __jsonTimeRanges) ? If( __jsonTimeRanges as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PointInTimeRange.FromJson(__u) )) ))() : null : TimeRange;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPoint. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPoint + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureWorkloadSAPHanaPointInTimeRecoveryPoint": + { + return new AzureWorkloadSapHanaPointInTimeRecoveryPoint(json); + } + } + return new AzureWorkloadPointInTimeRecoveryPoint(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadRecoveryPoint?.ToJson(container, serializationMode); + if (null != this._timeRange) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._timeRange ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("timeRanges",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRestoreRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRestoreRequest.cs new file mode 100644 index 000000000000..0b53dc52d5d2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRestoreRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + /// + public partial class AzureWorkloadPointInTimeRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequest(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType = value ; } + + /// Backing field for property. + private global::System.DateTime? _pointInTime; + + /// PointInTime value + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? PointInTime { get => this._pointInTime; set => this._pointInTime = value; } + + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag = value ?? null /* model class */; } + + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode)""); } + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType)""); } + + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId = value ?? null; } + + /// Details of target database + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo = value ?? null /* model class */; } + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId = value ?? null; } + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName = value ?? null; } + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions)""); } + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoTargetDirectoryForFileRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore = value ?? null; } + + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetVirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId = value ?? null; } + + /// Creates an new instance. + public AzureWorkloadPointInTimeRestoreRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadRestoreRequest), __azureWorkloadRestoreRequest); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadRestoreRequest), __azureWorkloadRestoreRequest); + } + } + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + public partial interface IAzureWorkloadPointInTimeRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest + { + /// PointInTime value + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"PointInTime value", + SerializedName = @"pointInTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PointInTime { get; set; } + + } + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + internal partial interface IAzureWorkloadPointInTimeRestoreRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal + { + /// PointInTime value + global::System.DateTime? PointInTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRestoreRequest.json.cs new file mode 100644 index 000000000000..f2259707c9a3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadPointInTimeRestoreRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + /// + public partial class AzureWorkloadPointInTimeRestoreRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadPointInTimeRestoreRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequest(json); + {_pointInTime = If( json?.PropertyT("pointInTime"), out var __jsonPointInTime) ? global::System.DateTime.TryParse((string)__jsonPointInTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPointInTimeValue) ? __jsonPointInTimeValue : PointInTime : PointInTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRestoreRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadPointInTimeRestoreRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadRestoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._pointInTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._pointInTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "pointInTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPoint.cs new file mode 100644 index 000000000000..f701e7384d31 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPoint.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Workload specific recovery point, specifically encapsulates full/diff recovery point + /// + public partial class AzureWorkloadRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__recoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__recoveryPoint).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo _recoveryPointMoveReadinessInfo; + + /// Eligibility of RP to be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => (this._recoveryPointMoveReadinessInfo = this._recoveryPointMoveReadinessInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRecoveryPointMoveReadinessInfo()); set => this._recoveryPointMoveReadinessInfo = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] _recoveryPointTierDetail; + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get => this._recoveryPointTierDetail; set => this._recoveryPointTierDetail = value; } + + /// Backing field for property. + private global::System.DateTime? _recoveryPointTimeInUtc; + + /// UTC time at which recovery point was created + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? RecoveryPointTimeInUtc { get => this._recoveryPointTimeInUtc; set => this._recoveryPointTimeInUtc = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? _type; + + /// Type of restore point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public AzureWorkloadRecoveryPoint() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__recoveryPoint), __recoveryPoint); + await eventListener.AssertObjectIsValid(nameof(__recoveryPoint), __recoveryPoint); + } + } + /// Workload specific recovery point, specifically encapsulates full/diff recovery point + public partial interface IAzureWorkloadRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint + { + /// Eligibility of RP to be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Eligibility of RP to be moved to another tier", + SerializedName = @"recoveryPointMoveReadinessInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get; set; } + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point tier information.", + SerializedName = @"recoveryPointTierDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get; set; } + /// UTC time at which recovery point was created + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC time at which recovery point was created", + SerializedName = @"recoveryPointTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecoveryPointTimeInUtc { get; set; } + /// Type of restore point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of restore point", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Type { get; set; } + + } + /// Workload specific recovery point, specifically encapsulates full/diff recovery point + internal partial interface IAzureWorkloadRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal + { + /// Eligibility of RP to be moved to another tier + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get; set; } + /// Recovery point tier information. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get; set; } + /// UTC time at which recovery point was created + global::System.DateTime? RecoveryPointTimeInUtc { get; set; } + /// Type of restore point + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPoint.json.cs new file mode 100644 index 000000000000..06da218ca09b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPoint.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Workload specific recovery point, specifically encapsulates full/diff recovery point + /// + public partial class AzureWorkloadRecoveryPoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadRecoveryPoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint(json); + {_recoveryPointTimeInUtc = If( json?.PropertyT("recoveryPointTimeInUTC"), out var __jsonRecoveryPointTimeInUtc) ? global::System.DateTime.TryParse((string)__jsonRecoveryPointTimeInUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRecoveryPointTimeInUtcValue) ? __jsonRecoveryPointTimeInUtcValue : RecoveryPointTimeInUtc : RecoveryPointTimeInUtc;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_recoveryPointTierDetail = If( json?.PropertyT("recoveryPointTierDetails"), out var __jsonRecoveryPointTierDetails) ? If( __jsonRecoveryPointTierDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointTierInformationV2.FromJson(__u) )) ))() : null : RecoveryPointTierDetail;} + {_recoveryPointMoveReadinessInfo = If( json?.PropertyT("recoveryPointMoveReadinessInfo"), out var __jsonRecoveryPointMoveReadinessInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRecoveryPointMoveReadinessInfo.FromJson(__jsonRecoveryPointMoveReadinessInfo) : RecoveryPointMoveReadinessInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureWorkloadPointInTimeRecoveryPoint": + { + return new AzureWorkloadPointInTimeRecoveryPoint(json); + } + case "AzureWorkloadSAPHanaPointInTimeRecoveryPoint": + { + return new AzureWorkloadSapHanaPointInTimeRecoveryPoint(json); + } + case "AzureWorkloadSAPHanaRecoveryPoint": + { + return new AzureWorkloadSapHanaRecoveryPoint(json); + } + case "AzureWorkloadSQLRecoveryPoint": + { + return new AzureWorkloadSqlRecoveryPoint(json); + } + case "AzureWorkloadSQLPointInTimeRecoveryPoint": + { + return new AzureWorkloadSqlPointInTimeRecoveryPoint(json); + } + } + return new AzureWorkloadRecoveryPoint(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __recoveryPoint?.ToJson(container, serializationMode); + AddIf( null != this._recoveryPointTimeInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointTimeInUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "recoveryPointTimeInUTC" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + if (null != this._recoveryPointTierDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recoveryPointTierDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("recoveryPointTierDetails",__w); + } + AddIf( null != this._recoveryPointMoveReadinessInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointMoveReadinessInfo.ToJson(null,serializationMode) : null, "recoveryPointMoveReadinessInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.cs new file mode 100644 index 000000000000..819974cc3432 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Eligibility of RP to be moved to another tier + public partial class AzureWorkloadRecoveryPointMoveReadinessInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfoInternal + { + + /// + /// Creates an new instance. + /// + public AzureWorkloadRecoveryPointMoveReadinessInfo() + { + + } + } + /// Eligibility of RP to be moved to another tier + public partial interface IAzureWorkloadRecoveryPointMoveReadinessInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Eligibility of RP to be moved to another tier + internal partial interface IAzureWorkloadRecoveryPointMoveReadinessInfoInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.dictionary.cs new file mode 100644 index 000000000000..5ab5f015d347 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AzureWorkloadRecoveryPointMoveReadinessInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfo this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfo value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfo value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRecoveryPointMoveReadinessInfo source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.json.cs new file mode 100644 index 000000000000..0ba84ac27147 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRecoveryPointMoveReadinessInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Eligibility of RP to be moved to another tier + public partial class AzureWorkloadRecoveryPointMoveReadinessInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureWorkloadRecoveryPointMoveReadinessInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointMoveReadinessInfo.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadRecoveryPointMoveReadinessInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequest.cs new file mode 100644 index 000000000000..59ad85c78d72 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequest.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload-specific restore. + public partial class AzureWorkloadRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest __restoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest(); + + /// Internal Acessors for TargetInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal.TargetInfo { get => (this._targetInfo = this._targetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.TargetRestoreInfo()); set { {_targetInfo = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__restoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__restoreRequest).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag _propertyBag; + + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequestPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? _recoveryMode; + + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get => this._recoveryMode; set => this._recoveryMode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? _recoveryType; + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => this._recoveryType; set => this._recoveryType = value; } + + /// Backing field for property. + private string _sourceResourceId; + + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo _targetInfo; + + /// Details of target database + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get => (this._targetInfo = this._targetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.TargetRestoreInfo()); set => this._targetInfo = value; } + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string TargetInfoContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfoInternal)TargetInfo).ContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfoInternal)TargetInfo).ContainerId = value ?? null; } + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string TargetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfoInternal)TargetInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfoInternal)TargetInfo).DatabaseName = value ?? null; } + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfoInternal)TargetInfo).OverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfoInternal)TargetInfo).OverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions)""); } + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string TargetInfoTargetDirectoryForFileRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfoInternal)TargetInfo).TargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfoInternal)TargetInfo).TargetDirectoryForFileRestore = value ?? null; } + + /// Backing field for property. + private string _targetVirtualMachineId; + + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetVirtualMachineId { get => this._targetVirtualMachineId; set => this._targetVirtualMachineId = value; } + + /// Creates an new instance. + public AzureWorkloadRestoreRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__restoreRequest), __restoreRequest); + await eventListener.AssertObjectIsValid(nameof(__restoreRequest), __restoreRequest); + } + } + /// AzureWorkload-specific restore. + public partial interface IAzureWorkloadRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest + { + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload specific property bag.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get; set; } + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Defines whether the current recovery mode is file restore or database restore", + SerializedName = @"recoveryMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get; set; } + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of this recovery.", + SerializedName = @"recoveryType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get; set; } + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM ID of the VM on which workload that was running is being recovered.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id name of the container in which Target DataBase resides", + SerializedName = @"containerId", + PossibleTypes = new [] { typeof(string) })] + string TargetInfoContainerId { get; set; } + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string TargetInfoDatabaseName { get; set; } + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can Overwrite if Target DataBase already exists", + SerializedName = @"overwriteOption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get; set; } + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target directory location for restore as files.", + SerializedName = @"targetDirectoryForFileRestore", + PossibleTypes = new [] { typeof(string) })] + string TargetInfoTargetDirectoryForFileRestore { get; set; } + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the complete ARM Id of the target VM + For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}", + SerializedName = @"targetVirtualMachineId", + PossibleTypes = new [] { typeof(string) })] + string TargetVirtualMachineId { get; set; } + + } + /// AzureWorkload-specific restore. + internal partial interface IAzureWorkloadRestoreRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal + { + /// Workload specific property bag. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get; set; } + /// Defines whether the current recovery mode is file restore or database restore + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get; set; } + /// Type of this recovery. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get; set; } + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + string SourceResourceId { get; set; } + /// Details of target database + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get; set; } + /// Resource Id name of the container in which Target DataBase resides + string TargetInfoContainerId { get; set; } + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + string TargetInfoDatabaseName { get; set; } + /// Can Overwrite if Target DataBase already exists + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get; set; } + /// Target directory location for restore as files. + string TargetInfoTargetDirectoryForFileRestore { get; set; } + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + string TargetVirtualMachineId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequest.json.cs new file mode 100644 index 000000000000..741756edf82d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequest.json.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload-specific restore. + public partial class AzureWorkloadRestoreRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadRestoreRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __restoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest(json); + {_targetInfo = If( json?.PropertyT("targetInfo"), out var __jsonTargetInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.TargetRestoreInfo.FromJson(__jsonTargetInfo) : TargetInfo;} + {_recoveryType = If( json?.PropertyT("recoveryType"), out var __jsonRecoveryType) ? (string)__jsonRecoveryType : (string)RecoveryType;} + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequestPropertyBag.FromJson(__jsonPropertyBag) : PropertyBag;} + {_recoveryMode = If( json?.PropertyT("recoveryMode"), out var __jsonRecoveryMode) ? (string)__jsonRecoveryMode : (string)RecoveryMode;} + {_targetVirtualMachineId = If( json?.PropertyT("targetVirtualMachineId"), out var __jsonTargetVirtualMachineId) ? (string)__jsonTargetVirtualMachineId : (string)TargetVirtualMachineId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureWorkloadPointInTimeRestoreRequest": + { + return new AzureWorkloadPointInTimeRestoreRequest(json); + } + case "AzureWorkloadSAPHanaPointInTimeRestoreRequest": + { + return new AzureWorkloadSapHanaPointInTimeRestoreRequest(json); + } + case "AzureWorkloadSAPHanaRestoreRequest": + { + return new AzureWorkloadSapHanaRestoreRequest(json); + } + case "AzureWorkloadSQLRestoreRequest": + { + return new AzureWorkloadSqlRestoreRequest(json); + } + case "AzureWorkloadSQLPointInTimeRestoreRequest": + { + return new AzureWorkloadSqlPointInTimeRestoreRequest(json); + } + case "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest": + { + return new AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest(json); + } + case "AzureWorkloadSAPHanaRestoreWithRehydrateRequest": + { + return new AzureWorkloadSapHanaRestoreWithRehydrateRequest(json); + } + case "AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest": + { + return new AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest(json); + } + case "AzureWorkloadSQLRestoreWithRehydrateRequest": + { + return new AzureWorkloadSqlRestoreWithRehydrateRequest(json); + } + } + return new AzureWorkloadRestoreRequest(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __restoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._targetInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._targetInfo.ToJson(null,serializationMode) : null, "targetInfo" ,container.Add ); + AddIf( null != (((object)this._recoveryType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryType.ToString()) : null, "recoveryType" ,container.Add ); + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + AddIf( null != this._propertyBag ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._propertyBag.ToJson(null,serializationMode) : null, "propertyBag" ,container.Add ); + AddIf( null != (((object)this._recoveryMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryMode.ToString()) : null, "recoveryMode" ,container.Add ); + AddIf( null != (((object)this._targetVirtualMachineId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetVirtualMachineId.ToString()) : null, "targetVirtualMachineId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.cs new file mode 100644 index 000000000000..10bb9df40c1b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Workload specific property bag. + public partial class AzureWorkloadRestoreRequestPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBagInternal + { + + /// Creates an new instance. + public AzureWorkloadRestoreRequestPropertyBag() + { + + } + } + /// Workload specific property bag. + public partial interface IAzureWorkloadRestoreRequestPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Workload specific property bag. + internal partial interface IAzureWorkloadRestoreRequestPropertyBagInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.dictionary.cs new file mode 100644 index 000000000000..1c8c62837442 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AzureWorkloadRestoreRequestPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequestPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.json.cs new file mode 100644 index 000000000000..e4d8ad0e553c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadRestoreRequestPropertyBag.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Workload specific property bag. + public partial class AzureWorkloadRestoreRequestPropertyBag + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureWorkloadRestoreRequestPropertyBag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadRestoreRequestPropertyBag(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRecoveryPoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRecoveryPoint.cs new file mode 100644 index 000000000000..9c5a354557b9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRecoveryPoint.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point specific to PointInTime in SAPHana + public partial class AzureWorkloadSapHanaPointInTimeRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPoint __azureWorkloadPointInTimeRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadPointInTimeRecoveryPoint(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).ObjectType = value ; } + + /// Eligibility of RP to be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointMoveReadinessInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointMoveReadinessInfo = value ?? null /* model class */; } + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointTierDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointTierDetail = value ?? null /* arrayOf */; } + + /// UTC time at which recovery point was created + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? RecoveryPointTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointTimeInUtc = value ?? default(global::System.DateTime); } + + /// List of log ranges + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange[] TimeRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).TimeRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).TimeRange = value ?? null /* arrayOf */; } + + /// Type of restore point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType)""); } + + /// + /// Creates an new instance. + /// + public AzureWorkloadSapHanaPointInTimeRecoveryPoint() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadPointInTimeRecoveryPoint), __azureWorkloadPointInTimeRecoveryPoint); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadPointInTimeRecoveryPoint), __azureWorkloadPointInTimeRecoveryPoint); + } + } + /// Recovery point specific to PointInTime in SAPHana + public partial interface IAzureWorkloadSapHanaPointInTimeRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPoint + { + + } + /// Recovery point specific to PointInTime in SAPHana + internal partial interface IAzureWorkloadSapHanaPointInTimeRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadPointInTimeRecoveryPointInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRecoveryPoint.json.cs new file mode 100644 index 000000000000..2d4315d6258b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRecoveryPoint.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point specific to PointInTime in SAPHana + public partial class AzureWorkloadSapHanaPointInTimeRecoveryPoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSapHanaPointInTimeRecoveryPoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadPointInTimeRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadPointInTimeRecoveryPoint(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRecoveryPoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSapHanaPointInTimeRecoveryPoint(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadPointInTimeRecoveryPoint?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreRequest.cs new file mode 100644 index 000000000000..d7a6c4d47bb4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreRequest.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + /// + public partial class AzureWorkloadSapHanaPointInTimeRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequest(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType = value ; } + + /// Backing field for property. + private global::System.DateTime? _pointInTime; + + /// PointInTime value + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? PointInTime { get => this._pointInTime; set => this._pointInTime = value; } + + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag = value ?? null /* model class */; } + + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode)""); } + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType)""); } + + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId = value ?? null; } + + /// Details of target database + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo = value ?? null /* model class */; } + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId = value ?? null; } + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName = value ?? null; } + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions)""); } + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoTargetDirectoryForFileRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore = value ?? null; } + + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetVirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureWorkloadSapHanaPointInTimeRestoreRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadRestoreRequest), __azureWorkloadRestoreRequest); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadRestoreRequest), __azureWorkloadRestoreRequest); + } + } + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + public partial interface IAzureWorkloadSapHanaPointInTimeRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest + { + /// PointInTime value + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"PointInTime value", + SerializedName = @"pointInTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PointInTime { get; set; } + + } + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + internal partial interface IAzureWorkloadSapHanaPointInTimeRestoreRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal + { + /// PointInTime value + global::System.DateTime? PointInTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreRequest.json.cs new file mode 100644 index 000000000000..c96b282def87 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + /// + public partial class AzureWorkloadSapHanaPointInTimeRestoreRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSapHanaPointInTimeRestoreRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequest(json); + {_pointInTime = If( json?.PropertyT("pointInTime"), out var __jsonPointInTime) ? global::System.DateTime.TryParse((string)__jsonPointInTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPointInTimeValue) ? __jsonPointInTimeValue : PointInTime : PointInTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequest + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest": + { + return new AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest(json); + } + } + return new AzureWorkloadSapHanaPointInTimeRestoreRequest(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadRestoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._pointInTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._pointInTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "pointInTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..dd7f5443b900 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + /// + public partial class AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequest __azureWorkloadSapHanaPointInTimeRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSapHanaPointInTimeRestoreRequest(); + + /// Internal Acessors for RecoveryPointRehydrationInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequestInternal.RecoveryPointRehydrationInfo { get => (this._recoveryPointRehydrationInfo = this._recoveryPointRehydrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo()); set { {_recoveryPointRehydrationInfo = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).ObjectType = value ; } + + /// PointInTime value + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? PointInTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).PointInTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).PointInTime = value ?? default(global::System.DateTime); } + + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).PropertyBag = value ?? null /* model class */; } + + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).RecoveryMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo _recoveryPointRehydrationInfo; + + /// RP Rehydration Info + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get => (this._recoveryPointRehydrationInfo = this._recoveryPointRehydrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo()); set => this._recoveryPointRehydrationInfo = value; } + + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationPriority; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationPriority = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority)""); } + + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationRetentionDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationRetentionDuration = value ?? null; } + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).RecoveryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType)""); } + + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).SourceResourceId = value ?? null; } + + /// Details of target database + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetInfo = value ?? null /* model class */; } + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetInfoContainerId = value ?? null; } + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetInfoDatabaseName = value ?? null; } + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetInfoOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions)""); } + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoTargetDirectoryForFileRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetInfoTargetDirectoryForFileRestore = value ?? null; } + + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetVirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSapHanaPointInTimeRestoreRequest).TargetVirtualMachineId = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadSapHanaPointInTimeRestoreRequest), __azureWorkloadSapHanaPointInTimeRestoreRequest); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadSapHanaPointInTimeRestoreRequest), __azureWorkloadSapHanaPointInTimeRestoreRequest); + } + } + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + public partial interface IAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequest + { + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rehydration Priority", + SerializedName = @"rehydrationPriority", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How long the rehydrated RP should be kept + Should be ISO8601 Duration format e.g. ""P7D""", + SerializedName = @"rehydrationRetentionDuration", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get; set; } + + } + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + internal partial interface IAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreRequestInternal + { + /// RP Rehydration Info + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + /// Rehydration Priority + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.json.cs new file mode 100644 index 000000000000..021bd04e6f6b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + /// + public partial class AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadSapHanaPointInTimeRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSapHanaPointInTimeRestoreRequest(json); + {_recoveryPointRehydrationInfo = If( json?.PropertyT("recoveryPointRehydrationInfo"), out var __jsonRecoveryPointRehydrationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo.FromJson(__jsonRecoveryPointRehydrationInfo) : RecoveryPointRehydrationInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadSapHanaPointInTimeRestoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._recoveryPointRehydrationInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointRehydrationInfo.ToJson(null,serializationMode) : null, "recoveryPointRehydrationInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRecoveryPoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRecoveryPoint.cs new file mode 100644 index 000000000000..0e1cdb416cd9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRecoveryPoint.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints + /// + public partial class AzureWorkloadSapHanaRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint __azureWorkloadRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRecoveryPoint(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__azureWorkloadRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__azureWorkloadRecoveryPoint).ObjectType = value ; } + + /// Eligibility of RP to be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo = value ?? null /* model class */; } + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTierDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTierDetail = value ?? null /* arrayOf */; } + + /// UTC time at which recovery point was created + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? RecoveryPointTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc = value ?? default(global::System.DateTime); } + + /// Type of restore point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType)""); } + + /// Creates an new instance. + public AzureWorkloadSapHanaRecoveryPoint() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadRecoveryPoint), __azureWorkloadRecoveryPoint); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadRecoveryPoint), __azureWorkloadRecoveryPoint); + } + } + /// SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints + public partial interface IAzureWorkloadSapHanaRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint + { + + } + /// SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints + internal partial interface IAzureWorkloadSapHanaRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRecoveryPoint.json.cs new file mode 100644 index 000000000000..e19da8db6bed --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRecoveryPoint.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints + /// + public partial class AzureWorkloadSapHanaRecoveryPoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSapHanaRecoveryPoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRecoveryPoint(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRecoveryPoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSapHanaRecoveryPoint(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadRecoveryPoint?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreRequest.cs new file mode 100644 index 000000000000..e3388d51c564 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload SAP Hana-specific restore. + public partial class AzureWorkloadSapHanaRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequest(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType = value ; } + + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag = value ?? null /* model class */; } + + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode)""); } + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType)""); } + + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId = value ?? null; } + + /// Details of target database + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo = value ?? null /* model class */; } + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId = value ?? null; } + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName = value ?? null; } + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions)""); } + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoTargetDirectoryForFileRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore = value ?? null; } + + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetVirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId = value ?? null; } + + /// Creates an new instance. + public AzureWorkloadSapHanaRestoreRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadRestoreRequest), __azureWorkloadRestoreRequest); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadRestoreRequest), __azureWorkloadRestoreRequest); + } + } + /// AzureWorkload SAP Hana-specific restore. + public partial interface IAzureWorkloadSapHanaRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest + { + + } + /// AzureWorkload SAP Hana-specific restore. + internal partial interface IAzureWorkloadSapHanaRestoreRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreRequest.json.cs new file mode 100644 index 000000000000..8c41234aab02 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload SAP Hana-specific restore. + public partial class AzureWorkloadSapHanaRestoreRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSapHanaRestoreRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequest(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSapHanaRestoreRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadRestoreRequest?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreWithRehydrateRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..899708dbbeae --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreWithRehydrateRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + /// + public partial class AzureWorkloadSapHanaRestoreWithRehydrateRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreWithRehydrateRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreWithRehydrateRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequest(); + + /// Internal Acessors for RecoveryPointRehydrationInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreWithRehydrateRequestInternal.RecoveryPointRehydrationInfo { get => (this._recoveryPointRehydrationInfo = this._recoveryPointRehydrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo()); set { {_recoveryPointRehydrationInfo = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType = value ; } + + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag = value ?? null /* model class */; } + + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo _recoveryPointRehydrationInfo; + + /// RP Rehydration Info + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get => (this._recoveryPointRehydrationInfo = this._recoveryPointRehydrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo()); set => this._recoveryPointRehydrationInfo = value; } + + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationPriority; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationPriority = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority)""); } + + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationRetentionDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationRetentionDuration = value ?? null; } + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType)""); } + + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId = value ?? null; } + + /// Details of target database + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo = value ?? null /* model class */; } + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId = value ?? null; } + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName = value ?? null; } + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions)""); } + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoTargetDirectoryForFileRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore = value ?? null; } + + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetVirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureWorkloadSapHanaRestoreWithRehydrateRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadRestoreRequest), __azureWorkloadRestoreRequest); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadRestoreRequest), __azureWorkloadRestoreRequest); + } + } + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + public partial interface IAzureWorkloadSapHanaRestoreWithRehydrateRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest + { + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rehydration Priority", + SerializedName = @"rehydrationPriority", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How long the rehydrated RP should be kept + Should be ISO8601 Duration format e.g. ""P7D""", + SerializedName = @"rehydrationRetentionDuration", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get; set; } + + } + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + internal partial interface IAzureWorkloadSapHanaRestoreWithRehydrateRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal + { + /// RP Rehydration Info + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + /// Rehydration Priority + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreWithRehydrateRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreWithRehydrateRequest.json.cs new file mode 100644 index 000000000000..ed641aa4a5e3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSapHanaRestoreWithRehydrateRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + /// + public partial class AzureWorkloadSapHanaRestoreWithRehydrateRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSapHanaRestoreWithRehydrateRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequest(json); + {_recoveryPointRehydrationInfo = If( json?.PropertyT("recoveryPointRehydrationInfo"), out var __jsonRecoveryPointRehydrationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo.FromJson(__jsonRecoveryPointRehydrationInfo) : RecoveryPointRehydrationInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreWithRehydrateRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreWithRehydrateRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSapHanaRestoreWithRehydrateRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSapHanaRestoreWithRehydrateRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadRestoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._recoveryPointRehydrationInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointRehydrationInfo.ToJson(null,serializationMode) : null, "recoveryPointRehydrationInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlAutoProtectionIntent.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlAutoProtectionIntent.cs new file mode 100644 index 000000000000..06736df0948a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlAutoProtectionIntent.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Workload SQL Auto Protection intent item. + public partial class AzureWorkloadSqlAutoProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlAutoProtectionIntent, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlAutoProtectionIntentInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureRecoveryServiceVaultProtectionIntent __azureRecoveryServiceVaultProtectionIntent = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureRecoveryServiceVaultProtectionIntent(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ItemId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).ItemId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).ItemId = value ?? null; } + + /// backup protectionIntent type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType ItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).ItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).ItemType = value ; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).PolicyId = value ?? null; } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)__azureRecoveryServiceVaultProtectionIntent).SourceResourceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType? _workloadItemType; + + /// Workload item type of the item for which intent is to be set + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType? WorkloadItemType { get => this._workloadItemType; set => this._workloadItemType = value; } + + /// Creates an new instance. + public AzureWorkloadSqlAutoProtectionIntent() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureRecoveryServiceVaultProtectionIntent), __azureRecoveryServiceVaultProtectionIntent); + await eventListener.AssertObjectIsValid(nameof(__azureRecoveryServiceVaultProtectionIntent), __azureRecoveryServiceVaultProtectionIntent); + } + } + /// Azure Workload SQL Auto Protection intent item. + public partial interface IAzureWorkloadSqlAutoProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureRecoveryServiceVaultProtectionIntent + { + /// Workload item type of the item for which intent is to be set + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload item type of the item for which intent is to be set", + SerializedName = @"workloadItemType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType? WorkloadItemType { get; set; } + + } + /// Azure Workload SQL Auto Protection intent item. + internal partial interface IAzureWorkloadSqlAutoProtectionIntentInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureRecoveryServiceVaultProtectionIntentInternal + { + /// Workload item type of the item for which intent is to be set + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType? WorkloadItemType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlAutoProtectionIntent.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlAutoProtectionIntent.json.cs new file mode 100644 index 000000000000..426c3f05b1ec --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlAutoProtectionIntent.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Workload SQL Auto Protection intent item. + public partial class AzureWorkloadSqlAutoProtectionIntent + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSqlAutoProtectionIntent(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureRecoveryServiceVaultProtectionIntent = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureRecoveryServiceVaultProtectionIntent(json); + {_workloadItemType = If( json?.PropertyT("workloadItemType"), out var __jsonWorkloadItemType) ? (string)__jsonWorkloadItemType : (string)WorkloadItemType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlAutoProtectionIntent. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlAutoProtectionIntent. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlAutoProtectionIntent FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSqlAutoProtectionIntent(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureRecoveryServiceVaultProtectionIntent?.ToJson(container, serializationMode); + AddIf( null != (((object)this._workloadItemType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadItemType.ToString()) : null, "workloadItemType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRecoveryPoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRecoveryPoint.cs new file mode 100644 index 000000000000..3d1689f88bc0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRecoveryPoint.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point specific to PointInTime + public partial class AzureWorkloadSqlPointInTimeRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPoint __azureWorkloadSqlRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlRecoveryPoint(); + + /// + /// 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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfo = value ?? null /* model class */; } + + /// List of data directory paths during restore operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] ExtendedInfoDataDirectoryPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfoDataDirectoryPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfoDataDirectoryPath = value ?? null /* arrayOf */; } + + /// UTC time at which data directory info was captured + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoDataDirectoryTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfoDataDirectoryTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfoDataDirectoryTimeInUtc = value ?? default(global::System.DateTime); } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ObjectType = value ; } + + /// Eligibility of RP to be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointMoveReadinessInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointMoveReadinessInfo = value ?? null /* model class */; } + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointTierDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointTierDetail = value ?? null /* arrayOf */; } + + /// UTC time at which recovery point was created + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? RecoveryPointTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointTimeInUtc = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange[] _timeRange; + + /// List of log ranges + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange[] TimeRange { get => this._timeRange; set => this._timeRange = value; } + + /// Type of restore point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType)""); } + + /// + /// Creates an new instance. + /// + public AzureWorkloadSqlPointInTimeRecoveryPoint() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadSqlRecoveryPoint), __azureWorkloadSqlRecoveryPoint); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadSqlRecoveryPoint), __azureWorkloadSqlRecoveryPoint); + } + } + /// Recovery point specific to PointInTime + public partial interface IAzureWorkloadSqlPointInTimeRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPoint + { + /// List of log ranges + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of log ranges", + SerializedName = @"timeRanges", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange[] TimeRange { get; set; } + + } + /// Recovery point specific to PointInTime + internal partial interface IAzureWorkloadSqlPointInTimeRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointInternal + { + /// List of log ranges + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange[] TimeRange { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRecoveryPoint.json.cs new file mode 100644 index 000000000000..aa3a5159c2f0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRecoveryPoint.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point specific to PointInTime + public partial class AzureWorkloadSqlPointInTimeRecoveryPoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSqlPointInTimeRecoveryPoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadSqlRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlRecoveryPoint(json); + {_timeRange = If( json?.PropertyT("timeRanges"), out var __jsonTimeRanges) ? If( __jsonTimeRanges as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PointInTimeRange.FromJson(__u) )) ))() : null : TimeRange;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRecoveryPoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSqlPointInTimeRecoveryPoint(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadSqlRecoveryPoint?.ToJson(container, serializationMode); + if (null != this._timeRange) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._timeRange ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("timeRanges",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreRequest.cs new file mode 100644 index 000000000000..09684143104f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreRequest.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore + public partial class AzureWorkloadSqlPointInTimeRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequest __azureWorkloadSqlRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlRestoreRequest(); + + /// Data directory details + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping[] AlternateDirectoryPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).AlternateDirectoryPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).AlternateDirectoryPath = value ?? null /* arrayOf */; } + + /// + /// SQL specific property where user can chose to set no-recovery when restore operation is tried + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsNonRecoverable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).IsNonRecoverable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).IsNonRecoverable = value ?? default(bool); } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).ObjectType = value ; } + + /// Backing field for property. + private global::System.DateTime? _pointInTime; + + /// PointInTime value + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? PointInTime { get => this._pointInTime; set => this._pointInTime = value; } + + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).PropertyBag = value ?? null /* model class */; } + + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).RecoveryMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode)""); } + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).RecoveryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType)""); } + + /// + /// Default option set to true. If this is set to false, alternate data directory must be provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? ShouldUseAlternateTargetLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).ShouldUseAlternateTargetLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).ShouldUseAlternateTargetLocation = value ?? default(bool); } + + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).SourceResourceId = value ?? null; } + + /// Details of target database + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfo = value ?? null /* model class */; } + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoContainerId = value ?? null; } + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoDatabaseName = value ?? null; } + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions)""); } + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoTargetDirectoryForFileRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoTargetDirectoryForFileRestore = value ?? null; } + + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetVirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetVirtualMachineId = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureWorkloadSqlPointInTimeRestoreRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadSqlRestoreRequest), __azureWorkloadSqlRestoreRequest); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadSqlRestoreRequest), __azureWorkloadSqlRestoreRequest); + } + } + /// AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore + public partial interface IAzureWorkloadSqlPointInTimeRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequest + { + /// PointInTime value + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"PointInTime value", + SerializedName = @"pointInTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PointInTime { get; set; } + + } + /// AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore + internal partial interface IAzureWorkloadSqlPointInTimeRestoreRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal + { + /// PointInTime value + global::System.DateTime? PointInTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreRequest.json.cs new file mode 100644 index 000000000000..cc003e554983 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore + public partial class AzureWorkloadSqlPointInTimeRestoreRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSqlPointInTimeRestoreRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadSqlRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlRestoreRequest(json); + {_pointInTime = If( json?.PropertyT("pointInTime"), out var __jsonPointInTime) ? global::System.DateTime.TryParse((string)__jsonPointInTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPointInTimeValue) ? __jsonPointInTimeValue : PointInTime : PointInTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequest + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest": + { + return new AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest(json); + } + } + return new AzureWorkloadSqlPointInTimeRestoreRequest(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadSqlRestoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._pointInTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._pointInTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "pointInTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..185fc62f1484 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SQL-specific restore with integrated rehydration of recovery point. + /// + public partial class AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequest __azureWorkloadSqlPointInTimeRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlPointInTimeRestoreRequest(); + + /// Data directory details + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping[] AlternateDirectoryPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).AlternateDirectoryPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).AlternateDirectoryPath = value ?? null /* arrayOf */; } + + /// + /// SQL specific property where user can chose to set no-recovery when restore operation is tried + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsNonRecoverable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).IsNonRecoverable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).IsNonRecoverable = value ?? default(bool); } + + /// Internal Acessors for RecoveryPointRehydrationInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequestInternal.RecoveryPointRehydrationInfo { get => (this._recoveryPointRehydrationInfo = this._recoveryPointRehydrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo()); set { {_recoveryPointRehydrationInfo = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).ObjectType = value ; } + + /// PointInTime value + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? PointInTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).PointInTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).PointInTime = value ?? default(global::System.DateTime); } + + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).PropertyBag = value ?? null /* model class */; } + + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).RecoveryMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo _recoveryPointRehydrationInfo; + + /// RP Rehydration Info + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get => (this._recoveryPointRehydrationInfo = this._recoveryPointRehydrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo()); set => this._recoveryPointRehydrationInfo = value; } + + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationPriority; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationPriority = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority)""); } + + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationRetentionDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationRetentionDuration = value ?? null; } + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).RecoveryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType)""); } + + /// + /// Default option set to true. If this is set to false, alternate data directory must be provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? ShouldUseAlternateTargetLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).ShouldUseAlternateTargetLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).ShouldUseAlternateTargetLocation = value ?? default(bool); } + + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).SourceResourceId = value ?? null; } + + /// Details of target database + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetInfo = value ?? null /* model class */; } + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetInfoContainerId = value ?? null; } + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetInfoDatabaseName = value ?? null; } + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetInfoOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions)""); } + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoTargetDirectoryForFileRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetInfoTargetDirectoryForFileRestore = value ?? null; } + + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetVirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlPointInTimeRestoreRequest).TargetVirtualMachineId = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadSqlPointInTimeRestoreRequest), __azureWorkloadSqlPointInTimeRestoreRequest); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadSqlPointInTimeRestoreRequest), __azureWorkloadSqlPointInTimeRestoreRequest); + } + } + /// AzureWorkload SQL-specific restore with integrated rehydration of recovery point. + public partial interface IAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequest + { + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rehydration Priority", + SerializedName = @"rehydrationPriority", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How long the rehydrated RP should be kept + Should be ISO8601 Duration format e.g. ""P7D""", + SerializedName = @"rehydrationRetentionDuration", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get; set; } + + } + /// AzureWorkload SQL-specific restore with integrated rehydration of recovery point. + internal partial interface IAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreRequestInternal + { + /// RP Rehydration Info + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + /// Rehydration Priority + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.json.cs new file mode 100644 index 000000000000..ea7e914fa1f7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SQL-specific restore with integrated rehydration of recovery point. + /// + public partial class AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadSqlPointInTimeRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlPointInTimeRestoreRequest(json); + {_recoveryPointRehydrationInfo = If( json?.PropertyT("recoveryPointRehydrationInfo"), out var __jsonRecoveryPointRehydrationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo.FromJson(__jsonRecoveryPointRehydrationInfo) : RecoveryPointRehydrationInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadSqlPointInTimeRestoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._recoveryPointRehydrationInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointRehydrationInfo.ToJson(null,serializationMode) : null, "recoveryPointRehydrationInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPoint.cs new file mode 100644 index 000000000000..b1ba181cf5a9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPoint.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info + /// + public partial class AzureWorkloadSqlRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint __azureWorkloadRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRecoveryPoint(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfo _extendedInfo; + + /// + /// 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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlRecoveryPointExtendedInfo()); set => this._extendedInfo = value; } + + /// List of data directory paths during restore operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] ExtendedInfoDataDirectoryPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)ExtendedInfo).DataDirectoryPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)ExtendedInfo).DataDirectoryPath = value ?? null /* arrayOf */; } + + /// UTC time at which data directory info was captured + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoDataDirectoryTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)ExtendedInfo).DataDirectoryTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)ExtendedInfo).DataDirectoryTimeInUtc = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlRecoveryPointExtendedInfo()); set { {_extendedInfo = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__azureWorkloadRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__azureWorkloadRecoveryPoint).ObjectType = value ; } + + /// Eligibility of RP to be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo = value ?? null /* model class */; } + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTierDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTierDetail = value ?? null /* arrayOf */; } + + /// UTC time at which recovery point was created + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? RecoveryPointTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc = value ?? default(global::System.DateTime); } + + /// Type of restore point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType)""); } + + /// Creates an new instance. + public AzureWorkloadSqlRecoveryPoint() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadRecoveryPoint), __azureWorkloadRecoveryPoint); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadRecoveryPoint), __azureWorkloadRecoveryPoint); + } + } + /// SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info + public partial interface IAzureWorkloadSqlRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPoint + { + /// List of data directory paths during restore operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of data directory paths during restore operation.", + SerializedName = @"dataDirectoryPaths", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] ExtendedInfoDataDirectoryPath { get; set; } + /// UTC time at which data directory info was captured + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC time at which data directory info was captured", + SerializedName = @"dataDirectoryTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoDataDirectoryTimeInUtc { get; set; } + + } + /// SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info + internal partial interface IAzureWorkloadSqlRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRecoveryPointInternal + { + /// + /// 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 + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfo ExtendedInfo { get; set; } + /// List of data directory paths during restore operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] ExtendedInfoDataDirectoryPath { get; set; } + /// UTC time at which data directory info was captured + global::System.DateTime? ExtendedInfoDataDirectoryTimeInUtc { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPoint.json.cs new file mode 100644 index 000000000000..cab82b9d72ad --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPoint.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info + /// + public partial class AzureWorkloadSqlRecoveryPoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSqlRecoveryPoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRecoveryPoint(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlRecoveryPointExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPoint. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPoint + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureWorkloadSQLPointInTimeRecoveryPoint": + { + return new AzureWorkloadSqlPointInTimeRecoveryPoint(json); + } + } + return new AzureWorkloadSqlRecoveryPoint(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadRecoveryPoint?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPointExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPointExtendedInfo.cs new file mode 100644 index 000000000000..5b1d563cbcb3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPointExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Extended info class details + public partial class AzureWorkloadSqlRecoveryPointExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] _dataDirectoryPath; + + /// List of data directory paths during restore operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] DataDirectoryPath { get => this._dataDirectoryPath; set => this._dataDirectoryPath = value; } + + /// Backing field for property. + private global::System.DateTime? _dataDirectoryTimeInUtc; + + /// UTC time at which data directory info was captured + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? DataDirectoryTimeInUtc { get => this._dataDirectoryTimeInUtc; set => this._dataDirectoryTimeInUtc = value; } + + /// + /// Creates an new instance. + /// + public AzureWorkloadSqlRecoveryPointExtendedInfo() + { + + } + } + /// Extended info class details + public partial interface IAzureWorkloadSqlRecoveryPointExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of data directory paths during restore operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of data directory paths during restore operation.", + SerializedName = @"dataDirectoryPaths", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] DataDirectoryPath { get; set; } + /// UTC time at which data directory info was captured + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC time at which data directory info was captured", + SerializedName = @"dataDirectoryTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DataDirectoryTimeInUtc { get; set; } + + } + /// Extended info class details + internal partial interface IAzureWorkloadSqlRecoveryPointExtendedInfoInternal + + { + /// List of data directory paths during restore operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory[] DataDirectoryPath { get; set; } + /// UTC time at which data directory info was captured + global::System.DateTime? DataDirectoryTimeInUtc { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPointExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPointExtendedInfo.json.cs new file mode 100644 index 000000000000..8347e02c1a83 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRecoveryPointExtendedInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Extended info class details + public partial class AzureWorkloadSqlRecoveryPointExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSqlRecoveryPointExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_dataDirectoryTimeInUtc = If( json?.PropertyT("dataDirectoryTimeInUTC"), out var __jsonDataDirectoryTimeInUtc) ? global::System.DateTime.TryParse((string)__jsonDataDirectoryTimeInUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDataDirectoryTimeInUtcValue) ? __jsonDataDirectoryTimeInUtcValue : DataDirectoryTimeInUtc : DataDirectoryTimeInUtc;} + {_dataDirectoryPath = If( json?.PropertyT("dataDirectoryPaths"), out var __jsonDataDirectoryPaths) ? If( __jsonDataDirectoryPaths as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SqlDataDirectory.FromJson(__u) )) ))() : null : DataDirectoryPath;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRecoveryPointExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSqlRecoveryPointExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._dataDirectoryTimeInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dataDirectoryTimeInUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "dataDirectoryTimeInUTC" ,container.Add ); + if (null != this._dataDirectoryPath) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._dataDirectoryPath ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("dataDirectoryPaths",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreRequest.cs new file mode 100644 index 000000000000..6f6a4c88e043 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreRequest.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload SQL -specific restore. Specifically for full/diff restore + public partial class AzureWorkloadSqlRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequest(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping[] _alternateDirectoryPath; + + /// Data directory details + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping[] AlternateDirectoryPath { get => this._alternateDirectoryPath; set => this._alternateDirectoryPath = value; } + + /// Backing field for property. + private bool? _isNonRecoverable; + + /// + /// SQL specific property where user can chose to set no-recovery when restore operation is tried + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsNonRecoverable { get => this._isNonRecoverable; set => this._isNonRecoverable = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType = value ; } + + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag = value ?? null /* model class */; } + + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode)""); } + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType)""); } + + /// Backing field for property. + private bool? _shouldUseAlternateTargetLocation; + + /// + /// Default option set to true. If this is set to false, alternate data directory must be provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? ShouldUseAlternateTargetLocation { get => this._shouldUseAlternateTargetLocation; set => this._shouldUseAlternateTargetLocation = value; } + + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId = value ?? null; } + + /// Details of target database + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo = value ?? null /* model class */; } + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId = value ?? null; } + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName = value ?? null; } + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions)""); } + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoTargetDirectoryForFileRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore = value ?? null; } + + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetVirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId = value ?? null; } + + /// Creates an new instance. + public AzureWorkloadSqlRestoreRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadRestoreRequest), __azureWorkloadRestoreRequest); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadRestoreRequest), __azureWorkloadRestoreRequest); + } + } + /// AzureWorkload SQL -specific restore. Specifically for full/diff restore + public partial interface IAzureWorkloadSqlRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequest + { + /// Data directory details + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data directory details", + SerializedName = @"alternateDirectoryPaths", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping[] AlternateDirectoryPath { get; set; } + /// + /// SQL specific property where user can chose to set no-recovery when restore operation is tried + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SQL specific property where user can chose to set no-recovery when restore operation is tried", + SerializedName = @"isNonRecoverable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsNonRecoverable { get; set; } + /// + /// Default option set to true. If this is set to false, alternate data directory must be provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default option set to true. If this is set to false, alternate data directory must be provided", + SerializedName = @"shouldUseAlternateTargetLocation", + PossibleTypes = new [] { typeof(bool) })] + bool? ShouldUseAlternateTargetLocation { get; set; } + + } + /// AzureWorkload SQL -specific restore. Specifically for full/diff restore + internal partial interface IAzureWorkloadSqlRestoreRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal + { + /// Data directory details + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping[] AlternateDirectoryPath { get; set; } + /// + /// SQL specific property where user can chose to set no-recovery when restore operation is tried + /// + bool? IsNonRecoverable { get; set; } + /// + /// Default option set to true. If this is set to false, alternate data directory must be provided + /// + bool? ShouldUseAlternateTargetLocation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreRequest.json.cs new file mode 100644 index 000000000000..02e4209aa9e3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreRequest.json.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload SQL -specific restore. Specifically for full/diff restore + public partial class AzureWorkloadSqlRestoreRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSqlRestoreRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadRestoreRequest(json); + {_shouldUseAlternateTargetLocation = If( json?.PropertyT("shouldUseAlternateTargetLocation"), out var __jsonShouldUseAlternateTargetLocation) ? (bool?)__jsonShouldUseAlternateTargetLocation : ShouldUseAlternateTargetLocation;} + {_isNonRecoverable = If( json?.PropertyT("isNonRecoverable"), out var __jsonIsNonRecoverable) ? (bool?)__jsonIsNonRecoverable : IsNonRecoverable;} + {_alternateDirectoryPath = If( json?.PropertyT("alternateDirectoryPaths"), out var __jsonAlternateDirectoryPaths) ? If( __jsonAlternateDirectoryPaths as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SqlDataDirectoryMapping.FromJson(__u) )) ))() : null : AlternateDirectoryPath;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequest + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureWorkloadSQLPointInTimeRestoreRequest": + { + return new AzureWorkloadSqlPointInTimeRestoreRequest(json); + } + case "AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest": + { + return new AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest(json); + } + case "AzureWorkloadSQLRestoreWithRehydrateRequest": + { + return new AzureWorkloadSqlRestoreWithRehydrateRequest(json); + } + } + return new AzureWorkloadSqlRestoreRequest(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadRestoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._shouldUseAlternateTargetLocation ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._shouldUseAlternateTargetLocation) : null, "shouldUseAlternateTargetLocation" ,container.Add ); + AddIf( null != this._isNonRecoverable ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isNonRecoverable) : null, "isNonRecoverable" ,container.Add ); + if (null != this._alternateDirectoryPath) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._alternateDirectoryPath ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("alternateDirectoryPaths",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreWithRehydrateRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..df4c5334e059 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreWithRehydrateRequest.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SQL-specific restore with integrated rehydration of recovery point + /// + public partial class AzureWorkloadSqlRestoreWithRehydrateRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreWithRehydrateRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreWithRehydrateRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequest __azureWorkloadSqlRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlRestoreRequest(); + + /// Data directory details + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping[] AlternateDirectoryPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).AlternateDirectoryPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).AlternateDirectoryPath = value ?? null /* arrayOf */; } + + /// + /// SQL specific property where user can chose to set no-recovery when restore operation is tried + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsNonRecoverable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).IsNonRecoverable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).IsNonRecoverable = value ?? default(bool); } + + /// Internal Acessors for RecoveryPointRehydrationInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreWithRehydrateRequestInternal.RecoveryPointRehydrationInfo { get => (this._recoveryPointRehydrationInfo = this._recoveryPointRehydrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo()); set { {_recoveryPointRehydrationInfo = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).ObjectType = value ; } + + /// Workload specific property bag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).PropertyBag = value ?? null /* model class */; } + + /// Defines whether the current recovery mode is file restore or database restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode? RecoveryMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).RecoveryMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo _recoveryPointRehydrationInfo; + + /// RP Rehydration Info + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get => (this._recoveryPointRehydrationInfo = this._recoveryPointRehydrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo()); set => this._recoveryPointRehydrationInfo = value; } + + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationPriority; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationPriority = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority)""); } + + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationRetentionDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationRetentionDuration = value ?? null; } + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).RecoveryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType)""); } + + /// + /// Default option set to true. If this is set to false, alternate data directory must be provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? ShouldUseAlternateTargetLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).ShouldUseAlternateTargetLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).ShouldUseAlternateTargetLocation = value ?? default(bool); } + + /// + /// Fully qualified ARM ID of the VM on which workload that was running is being recovered. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).SourceResourceId = value ?? null; } + + /// Details of target database + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfo = value ?? null /* model class */; } + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoContainerId = value ?? null; } + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoDatabaseName = value ?? null; } + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? TargetInfoOverwriteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoOverwriteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions)""); } + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetInfoTargetDirectoryForFileRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoTargetDirectoryForFileRestore = value ?? null; } + + /// + /// This is the complete ARM Id of the target VM + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetVirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetVirtualMachineId = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureWorkloadSqlRestoreWithRehydrateRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureWorkloadSqlRestoreRequest), __azureWorkloadSqlRestoreRequest); + await eventListener.AssertObjectIsValid(nameof(__azureWorkloadSqlRestoreRequest), __azureWorkloadSqlRestoreRequest); + } + } + /// AzureWorkload SQL-specific restore with integrated rehydration of recovery point + public partial interface IAzureWorkloadSqlRestoreWithRehydrateRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequest + { + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rehydration Priority", + SerializedName = @"rehydrationPriority", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How long the rehydrated RP should be kept + Should be ISO8601 Duration format e.g. ""P7D""", + SerializedName = @"rehydrationRetentionDuration", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get; set; } + + } + /// AzureWorkload SQL-specific restore with integrated rehydration of recovery point + internal partial interface IAzureWorkloadSqlRestoreWithRehydrateRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreRequestInternal + { + /// RP Rehydration Info + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + /// Rehydration Priority + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreWithRehydrateRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreWithRehydrateRequest.json.cs new file mode 100644 index 000000000000..34c812ea5036 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/AzureWorkloadSqlRestoreWithRehydrateRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// AzureWorkload SQL-specific restore with integrated rehydration of recovery point + /// + public partial class AzureWorkloadSqlRestoreWithRehydrateRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal AzureWorkloadSqlRestoreWithRehydrateRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureWorkloadSqlRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureWorkloadSqlRestoreRequest(json); + {_recoveryPointRehydrationInfo = If( json?.PropertyT("recoveryPointRehydrationInfo"), out var __jsonRecoveryPointRehydrationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo.FromJson(__jsonRecoveryPointRehydrationInfo) : RecoveryPointRehydrationInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreWithRehydrateRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreWithRehydrateRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IAzureWorkloadSqlRestoreWithRehydrateRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSqlRestoreWithRehydrateRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureWorkloadSqlRestoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._recoveryPointRehydrationInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointRehydrationInfo.ToJson(null,serializationMode) : null, "recoveryPointRehydrationInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBase.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBase.cs new file mode 100644 index 000000000000..e209410d735a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBase.cs @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// The base backup engine class. All workload specific backup engines derive from this class. + /// + public partial class BackupEngineBase : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal + { + + /// Backing field for property. + private string _azureBackupAgentVersion; + + /// Backup agent version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AzureBackupAgentVersion { get => this._azureBackupAgentVersion; set => this._azureBackupAgentVersion = value; } + + /// Backing field for property. + private string _backupEngineId; + + /// ID of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupEngineId { get => this._backupEngineId; set => this._backupEngineId = value; } + + /// Backing field for property. + private string _backupEngineState; + + /// + /// Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupEngineState { get => this._backupEngineState; set => this._backupEngineState = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType _backupEngineType; + + /// Type of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType BackupEngineType { get => this._backupEngineType; set => this._backupEngineType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Type of backup management for the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private bool? _canReRegister; + + /// Flag indicating if the backup engine be registered, once already registered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? CanReRegister { get => this._canReRegister; set => this._canReRegister = value; } + + /// Backing field for property. + private string _dpmVersion; + + /// Backup engine version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DpmVersion { get => this._dpmVersion; set => this._dpmVersion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo _extendedInfo; + + /// Extended info of the backupengine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineExtendedInfo()); set => this._extendedInfo = value; } + + /// Disk space currently available in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public double? ExtendedInfoAvailableDiskSpace { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).AvailableDiskSpace; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).AvailableDiskSpace = value ?? default(double); } + + /// Protected instances in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoAzureProtectedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).AzureProtectedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).AzureProtectedInstance = value ?? default(int); } + + /// Database name of backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).DatabaseName = value ?? null; } + + /// Number of disks in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoDiskCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).DiskCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).DiskCount = value ?? default(int); } + + /// Number of protected items in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).ProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).ProtectedItemsCount = value ?? default(int); } + + /// Number of protected servers in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoProtectedServersCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).ProtectedServersCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).ProtectedServersCount = value ?? default(int); } + + /// Last refresh time in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoRefreshedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).RefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).RefreshedAt = value ?? default(global::System.DateTime); } + + /// Disk space used in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public double? ExtendedInfoUsedDiskSpace { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).UsedDiskSpace; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal)ExtendedInfo).UsedDiskSpace = value ?? default(double); } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Backing field for property. + private string _healthStatus; + + /// Backup status of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string HealthStatus { get => this._healthStatus; set => this._healthStatus = value; } + + /// Backing field for property. + private bool? _isAzureBackupAgentUpgradeAvailable; + + /// To check if backup agent upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsAzureBackupAgentUpgradeAvailable { get => this._isAzureBackupAgentUpgradeAvailable; set => this._isAzureBackupAgentUpgradeAvailable = value; } + + /// Backing field for property. + private bool? _isDpmUpgradeAvailable; + + /// To check if backup engine upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsDpmUpgradeAvailable { get => this._isDpmUpgradeAvailable; set => this._isDpmUpgradeAvailable = value; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Backing field for property. + private string _registrationStatus; + + /// Registration status of the backup engine with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RegistrationStatus { get => this._registrationStatus; set => this._registrationStatus = value; } + + /// Creates an new instance. + public BackupEngineBase() + { + + } + } + /// The base backup engine class. All workload specific backup engines derive from this class. + public partial interface IBackupEngineBase : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup agent version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup agent version", + SerializedName = @"azureBackupAgentVersion", + PossibleTypes = new [] { typeof(string) })] + string AzureBackupAgentVersion { get; set; } + /// ID of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the backup engine.", + SerializedName = @"backupEngineId", + PossibleTypes = new [] { typeof(string) })] + string BackupEngineId { get; set; } + /// + /// Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed}", + SerializedName = @"backupEngineState", + PossibleTypes = new [] { typeof(string) })] + string BackupEngineState { get; set; } + /// Type of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the backup engine.", + SerializedName = @"backupEngineType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType BackupEngineType { get; set; } + /// Type of backup management for the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the backup engine.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Flag indicating if the backup engine be registered, once already registered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag indicating if the backup engine be registered, once already registered.", + SerializedName = @"canReRegister", + PossibleTypes = new [] { typeof(bool) })] + bool? CanReRegister { get; set; } + /// Backup engine version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup engine version", + SerializedName = @"dpmVersion", + PossibleTypes = new [] { typeof(string) })] + string DpmVersion { get; set; } + /// Disk space currently available in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disk space currently available in the backup engine.", + SerializedName = @"availableDiskSpace", + PossibleTypes = new [] { typeof(double) })] + double? ExtendedInfoAvailableDiskSpace { get; set; } + /// Protected instances in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protected instances in the backup engine.", + SerializedName = @"azureProtectedInstances", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoAzureProtectedInstance { get; set; } + /// Database name of backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database name of backup engine.", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoDatabaseName { get; set; } + /// Number of disks in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of disks in the backup engine.", + SerializedName = @"diskCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoDiskCount { get; set; } + /// Number of protected items in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of protected items in the backup engine.", + SerializedName = @"protectedItemsCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoProtectedItemsCount { get; set; } + /// Number of protected servers in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of protected servers in the backup engine.", + SerializedName = @"protectedServersCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoProtectedServersCount { get; set; } + /// Last refresh time in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last refresh time in the backup engine.", + SerializedName = @"refreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoRefreshedAt { get; set; } + /// Disk space used in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disk space used in the backup engine.", + SerializedName = @"usedDiskSpace", + PossibleTypes = new [] { typeof(double) })] + double? ExtendedInfoUsedDiskSpace { get; set; } + /// Friendly name of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the backup engine.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Backup status of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup status of the backup engine.", + SerializedName = @"healthStatus", + PossibleTypes = new [] { typeof(string) })] + string HealthStatus { get; set; } + /// To check if backup agent upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if backup agent upgrade available", + SerializedName = @"isAzureBackupAgentUpgradeAvailable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsAzureBackupAgentUpgradeAvailable { get; set; } + /// To check if backup engine upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if backup engine upgrade available", + SerializedName = @"isDpmUpgradeAvailable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDpmUpgradeAvailable { get; set; } + /// Registration status of the backup engine with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Registration status of the backup engine with the Recovery Services Vault.", + SerializedName = @"registrationStatus", + PossibleTypes = new [] { typeof(string) })] + string RegistrationStatus { get; set; } + + } + /// The base backup engine class. All workload specific backup engines derive from this class. + internal partial interface IBackupEngineBaseInternal + + { + /// Backup agent version + string AzureBackupAgentVersion { get; set; } + /// ID of the backup engine. + string BackupEngineId { get; set; } + /// + /// Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + /// + string BackupEngineState { get; set; } + /// Type of the backup engine. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType BackupEngineType { get; set; } + /// Type of backup management for the backup engine. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Flag indicating if the backup engine be registered, once already registered. + bool? CanReRegister { get; set; } + /// Backup engine version + string DpmVersion { get; set; } + /// Extended info of the backupengine + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo ExtendedInfo { get; set; } + /// Disk space currently available in the backup engine. + double? ExtendedInfoAvailableDiskSpace { get; set; } + /// Protected instances in the backup engine. + int? ExtendedInfoAzureProtectedInstance { get; set; } + /// Database name of backup engine. + string ExtendedInfoDatabaseName { get; set; } + /// Number of disks in the backup engine. + int? ExtendedInfoDiskCount { get; set; } + /// Number of protected items in the backup engine. + int? ExtendedInfoProtectedItemsCount { get; set; } + /// Number of protected servers in the backup engine. + int? ExtendedInfoProtectedServersCount { get; set; } + /// Last refresh time in the backup engine. + global::System.DateTime? ExtendedInfoRefreshedAt { get; set; } + /// Disk space used in the backup engine. + double? ExtendedInfoUsedDiskSpace { get; set; } + /// Friendly name of the backup engine. + string FriendlyName { get; set; } + /// Backup status of the backup engine. + string HealthStatus { get; set; } + /// To check if backup agent upgrade available + bool? IsAzureBackupAgentUpgradeAvailable { get; set; } + /// To check if backup engine upgrade available + bool? IsDpmUpgradeAvailable { get; set; } + /// Registration status of the backup engine with the Recovery Services Vault. + string RegistrationStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBase.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBase.json.cs new file mode 100644 index 000000000000..289b633f0b07 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBase.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// The base backup engine class. All workload specific backup engines derive from this class. + /// + public partial class BackupEngineBase + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupEngineBase(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_registrationStatus = If( json?.PropertyT("registrationStatus"), out var __jsonRegistrationStatus) ? (string)__jsonRegistrationStatus : (string)RegistrationStatus;} + {_backupEngineState = If( json?.PropertyT("backupEngineState"), out var __jsonBackupEngineState) ? (string)__jsonBackupEngineState : (string)BackupEngineState;} + {_healthStatus = If( json?.PropertyT("healthStatus"), out var __jsonHealthStatus) ? (string)__jsonHealthStatus : (string)HealthStatus;} + {_backupEngineType = If( json?.PropertyT("backupEngineType"), out var __jsonBackupEngineType) ? (string)__jsonBackupEngineType : (string)BackupEngineType;} + {_canReRegister = If( json?.PropertyT("canReRegister"), out var __jsonCanReRegister) ? (bool?)__jsonCanReRegister : CanReRegister;} + {_backupEngineId = If( json?.PropertyT("backupEngineId"), out var __jsonBackupEngineId) ? (string)__jsonBackupEngineId : (string)BackupEngineId;} + {_dpmVersion = If( json?.PropertyT("dpmVersion"), out var __jsonDpmVersion) ? (string)__jsonDpmVersion : (string)DpmVersion;} + {_azureBackupAgentVersion = If( json?.PropertyT("azureBackupAgentVersion"), out var __jsonAzureBackupAgentVersion) ? (string)__jsonAzureBackupAgentVersion : (string)AzureBackupAgentVersion;} + {_isAzureBackupAgentUpgradeAvailable = If( json?.PropertyT("isAzureBackupAgentUpgradeAvailable"), out var __jsonIsAzureBackupAgentUpgradeAvailable) ? (bool?)__jsonIsAzureBackupAgentUpgradeAvailable : IsAzureBackupAgentUpgradeAvailable;} + {_isDpmUpgradeAvailable = If( json?.PropertyT("isDpmUpgradeAvailable"), out var __jsonIsDpmUpgradeAvailable) ? (bool?)__jsonIsDpmUpgradeAvailable : IsDpmUpgradeAvailable;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase interface is + /// polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("backupEngineType") ) + { + case "AzureBackupServerEngine": + { + return new AzureBackupServerEngine(json); + } + case "DpmBackupEngine": + { + return new DpmBackupEngine(json); + } + } + return new BackupEngineBase(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._registrationStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._registrationStatus.ToString()) : null, "registrationStatus" ,container.Add ); + AddIf( null != (((object)this._backupEngineState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupEngineState.ToString()) : null, "backupEngineState" ,container.Add ); + AddIf( null != (((object)this._healthStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._healthStatus.ToString()) : null, "healthStatus" ,container.Add ); + AddIf( null != (((object)this._backupEngineType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupEngineType.ToString()) : null, "backupEngineType" ,container.Add ); + AddIf( null != this._canReRegister ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._canReRegister) : null, "canReRegister" ,container.Add ); + AddIf( null != (((object)this._backupEngineId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupEngineId.ToString()) : null, "backupEngineId" ,container.Add ); + AddIf( null != (((object)this._dpmVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dpmVersion.ToString()) : null, "dpmVersion" ,container.Add ); + AddIf( null != (((object)this._azureBackupAgentVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._azureBackupAgentVersion.ToString()) : null, "azureBackupAgentVersion" ,container.Add ); + AddIf( null != this._isAzureBackupAgentUpgradeAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isAzureBackupAgentUpgradeAvailable) : null, "isAzureBackupAgentUpgradeAvailable" ,container.Add ); + AddIf( null != this._isDpmUpgradeAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isDpmUpgradeAvailable) : null, "isDpmUpgradeAvailable" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResource.cs new file mode 100644 index 000000000000..dcaca1b0ce97 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResource.cs @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// The base backup engine class. All workload specific backup engines derive from this class. + /// + public partial class BackupEngineBaseResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Backup agent version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string AzureBackupAgentVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).AzureBackupAgentVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).AzureBackupAgentVersion = value ?? null; } + + /// ID of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BackupEngineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).BackupEngineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).BackupEngineId = value ?? null; } + + /// + /// Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BackupEngineState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).BackupEngineState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).BackupEngineState = value ?? null; } + + /// Type of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType? BackupEngineType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).BackupEngineType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).BackupEngineType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType)""); } + + /// Type of backup management for the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Flag indicating if the backup engine be registered, once already registered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? CanReRegister { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).CanReRegister; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).CanReRegister = value ?? default(bool); } + + /// Backup engine version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string DpmVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).DpmVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).DpmVersion = value ?? null; } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Disk space currently available in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public double? ExtendedInfoAvailableDiskSpace { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoAvailableDiskSpace; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoAvailableDiskSpace = value ?? default(double); } + + /// Protected instances in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoAzureProtectedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoAzureProtectedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoAzureProtectedInstance = value ?? default(int); } + + /// Database name of backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoDatabaseName = value ?? null; } + + /// Number of disks in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoDiskCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoDiskCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoDiskCount = value ?? default(int); } + + /// Number of protected items in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoProtectedItemsCount = value ?? default(int); } + + /// Number of protected servers in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoProtectedServersCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoProtectedServersCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoProtectedServersCount = value ?? default(int); } + + /// Last refresh time in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoRefreshedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoRefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoRefreshedAt = value ?? default(global::System.DateTime); } + + /// Disk space used in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public double? ExtendedInfoUsedDiskSpace { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoUsedDiskSpace; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfoUsedDiskSpace = value ?? default(double); } + + /// Friendly name of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).FriendlyName = value ?? null; } + + /// Backup status of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).HealthStatus = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// To check if backup agent upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? IsAzureBackupAgentUpgradeAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).IsAzureBackupAgentUpgradeAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).IsAzureBackupAgentUpgradeAvailable = value ?? default(bool); } + + /// To check if backup engine upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? IsDpmUpgradeAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).IsDpmUpgradeAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).IsDpmUpgradeAvailable = value ?? default(bool); } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResourceInternal.ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).ExtendedInfo = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineBase()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase _property; + + /// BackupEngineBaseResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineBase()); set => this._property = value; } + + /// Registration status of the backup engine with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)Property).RegistrationStatus = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public BackupEngineBaseResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The base backup engine class. All workload specific backup engines derive from this class. + public partial interface IBackupEngineBaseResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Backup agent version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup agent version", + SerializedName = @"azureBackupAgentVersion", + PossibleTypes = new [] { typeof(string) })] + string AzureBackupAgentVersion { get; set; } + /// ID of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the backup engine.", + SerializedName = @"backupEngineId", + PossibleTypes = new [] { typeof(string) })] + string BackupEngineId { get; set; } + /// + /// Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed}", + SerializedName = @"backupEngineState", + PossibleTypes = new [] { typeof(string) })] + string BackupEngineState { get; set; } + /// Type of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the backup engine.", + SerializedName = @"backupEngineType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType? BackupEngineType { get; set; } + /// Type of backup management for the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the backup engine.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Flag indicating if the backup engine be registered, once already registered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag indicating if the backup engine be registered, once already registered.", + SerializedName = @"canReRegister", + PossibleTypes = new [] { typeof(bool) })] + bool? CanReRegister { get; set; } + /// Backup engine version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup engine version", + SerializedName = @"dpmVersion", + PossibleTypes = new [] { typeof(string) })] + string DpmVersion { get; set; } + /// Disk space currently available in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disk space currently available in the backup engine.", + SerializedName = @"availableDiskSpace", + PossibleTypes = new [] { typeof(double) })] + double? ExtendedInfoAvailableDiskSpace { get; set; } + /// Protected instances in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protected instances in the backup engine.", + SerializedName = @"azureProtectedInstances", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoAzureProtectedInstance { get; set; } + /// Database name of backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database name of backup engine.", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoDatabaseName { get; set; } + /// Number of disks in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of disks in the backup engine.", + SerializedName = @"diskCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoDiskCount { get; set; } + /// Number of protected items in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of protected items in the backup engine.", + SerializedName = @"protectedItemsCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoProtectedItemsCount { get; set; } + /// Number of protected servers in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of protected servers in the backup engine.", + SerializedName = @"protectedServersCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoProtectedServersCount { get; set; } + /// Last refresh time in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last refresh time in the backup engine.", + SerializedName = @"refreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoRefreshedAt { get; set; } + /// Disk space used in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disk space used in the backup engine.", + SerializedName = @"usedDiskSpace", + PossibleTypes = new [] { typeof(double) })] + double? ExtendedInfoUsedDiskSpace { get; set; } + /// Friendly name of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the backup engine.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Backup status of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup status of the backup engine.", + SerializedName = @"healthStatus", + PossibleTypes = new [] { typeof(string) })] + string HealthStatus { get; set; } + /// To check if backup agent upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if backup agent upgrade available", + SerializedName = @"isAzureBackupAgentUpgradeAvailable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsAzureBackupAgentUpgradeAvailable { get; set; } + /// To check if backup engine upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if backup engine upgrade available", + SerializedName = @"isDpmUpgradeAvailable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDpmUpgradeAvailable { get; set; } + /// Registration status of the backup engine with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Registration status of the backup engine with the Recovery Services Vault.", + SerializedName = @"registrationStatus", + PossibleTypes = new [] { typeof(string) })] + string RegistrationStatus { get; set; } + + } + /// The base backup engine class. All workload specific backup engines derive from this class. + internal partial interface IBackupEngineBaseResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Backup agent version + string AzureBackupAgentVersion { get; set; } + /// ID of the backup engine. + string BackupEngineId { get; set; } + /// + /// Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + /// + string BackupEngineState { get; set; } + /// Type of the backup engine. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType? BackupEngineType { get; set; } + /// Type of backup management for the backup engine. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Flag indicating if the backup engine be registered, once already registered. + bool? CanReRegister { get; set; } + /// Backup engine version + string DpmVersion { get; set; } + /// Extended info of the backupengine + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo ExtendedInfo { get; set; } + /// Disk space currently available in the backup engine. + double? ExtendedInfoAvailableDiskSpace { get; set; } + /// Protected instances in the backup engine. + int? ExtendedInfoAzureProtectedInstance { get; set; } + /// Database name of backup engine. + string ExtendedInfoDatabaseName { get; set; } + /// Number of disks in the backup engine. + int? ExtendedInfoDiskCount { get; set; } + /// Number of protected items in the backup engine. + int? ExtendedInfoProtectedItemsCount { get; set; } + /// Number of protected servers in the backup engine. + int? ExtendedInfoProtectedServersCount { get; set; } + /// Last refresh time in the backup engine. + global::System.DateTime? ExtendedInfoRefreshedAt { get; set; } + /// Disk space used in the backup engine. + double? ExtendedInfoUsedDiskSpace { get; set; } + /// Friendly name of the backup engine. + string FriendlyName { get; set; } + /// Backup status of the backup engine. + string HealthStatus { get; set; } + /// To check if backup agent upgrade available + bool? IsAzureBackupAgentUpgradeAvailable { get; set; } + /// To check if backup engine upgrade available + bool? IsDpmUpgradeAvailable { get; set; } + /// BackupEngineBaseResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase Property { get; set; } + /// Registration status of the backup engine with the Recovery Services Vault. + string RegistrationStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResource.json.cs new file mode 100644 index 000000000000..3a209ad3ee60 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// The base backup engine class. All workload specific backup engines derive from this class. + /// + public partial class BackupEngineBaseResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupEngineBaseResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineBase.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupEngineBaseResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResourceList.cs new file mode 100644 index 000000000000..2919036e23c7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of BackupEngineBase resources + public partial class BackupEngineBaseResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public BackupEngineBaseResourceList() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + } + /// List of BackupEngineBase resources + public partial interface IBackupEngineBaseResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResource[] Value { get; set; } + + } + /// List of BackupEngineBase resources + internal partial interface IBackupEngineBaseResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResourceList.json.cs new file mode 100644 index 000000000000..45560c5004c8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineBaseResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of BackupEngineBase resources + public partial class BackupEngineBaseResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupEngineBaseResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineBaseResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupEngineBaseResourceList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineExtendedInfo.cs new file mode 100644 index 000000000000..f1648c625639 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineExtendedInfo.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on backup engine. + public partial class BackupEngineExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfoInternal + { + + /// Backing field for property. + private double? _availableDiskSpace; + + /// Disk space currently available in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public double? AvailableDiskSpace { get => this._availableDiskSpace; set => this._availableDiskSpace = value; } + + /// Backing field for property. + private int? _azureProtectedInstance; + + /// Protected instances in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? AzureProtectedInstance { get => this._azureProtectedInstance; set => this._azureProtectedInstance = value; } + + /// Backing field for property. + private string _databaseName; + + /// Database name of backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; set => this._databaseName = value; } + + /// Backing field for property. + private int? _diskCount; + + /// Number of disks in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? DiskCount { get => this._diskCount; set => this._diskCount = value; } + + /// Backing field for property. + private int? _protectedItemsCount; + + /// Number of protected items in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? ProtectedItemsCount { get => this._protectedItemsCount; set => this._protectedItemsCount = value; } + + /// Backing field for property. + private int? _protectedServersCount; + + /// Number of protected servers in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? ProtectedServersCount { get => this._protectedServersCount; set => this._protectedServersCount = value; } + + /// Backing field for property. + private global::System.DateTime? _refreshedAt; + + /// Last refresh time in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? RefreshedAt { get => this._refreshedAt; set => this._refreshedAt = value; } + + /// Backing field for property. + private double? _usedDiskSpace; + + /// Disk space used in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public double? UsedDiskSpace { get => this._usedDiskSpace; set => this._usedDiskSpace = value; } + + /// Creates an new instance. + public BackupEngineExtendedInfo() + { + + } + } + /// Additional information on backup engine. + public partial interface IBackupEngineExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Disk space currently available in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disk space currently available in the backup engine.", + SerializedName = @"availableDiskSpace", + PossibleTypes = new [] { typeof(double) })] + double? AvailableDiskSpace { get; set; } + /// Protected instances in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protected instances in the backup engine.", + SerializedName = @"azureProtectedInstances", + PossibleTypes = new [] { typeof(int) })] + int? AzureProtectedInstance { get; set; } + /// Database name of backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database name of backup engine.", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; set; } + /// Number of disks in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of disks in the backup engine.", + SerializedName = @"diskCount", + PossibleTypes = new [] { typeof(int) })] + int? DiskCount { get; set; } + /// Number of protected items in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of protected items in the backup engine.", + SerializedName = @"protectedItemsCount", + PossibleTypes = new [] { typeof(int) })] + int? ProtectedItemsCount { get; set; } + /// Number of protected servers in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of protected servers in the backup engine.", + SerializedName = @"protectedServersCount", + PossibleTypes = new [] { typeof(int) })] + int? ProtectedServersCount { get; set; } + /// Last refresh time in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last refresh time in the backup engine.", + SerializedName = @"refreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RefreshedAt { get; set; } + /// Disk space used in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disk space used in the backup engine.", + SerializedName = @"usedDiskSpace", + PossibleTypes = new [] { typeof(double) })] + double? UsedDiskSpace { get; set; } + + } + /// Additional information on backup engine. + internal partial interface IBackupEngineExtendedInfoInternal + + { + /// Disk space currently available in the backup engine. + double? AvailableDiskSpace { get; set; } + /// Protected instances in the backup engine. + int? AzureProtectedInstance { get; set; } + /// Database name of backup engine. + string DatabaseName { get; set; } + /// Number of disks in the backup engine. + int? DiskCount { get; set; } + /// Number of protected items in the backup engine. + int? ProtectedItemsCount { get; set; } + /// Number of protected servers in the backup engine. + int? ProtectedServersCount { get; set; } + /// Last refresh time in the backup engine. + global::System.DateTime? RefreshedAt { get; set; } + /// Disk space used in the backup engine. + double? UsedDiskSpace { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineExtendedInfo.json.cs new file mode 100644 index 000000000000..6076d4b2779c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupEngineExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on backup engine. + public partial class BackupEngineExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupEngineExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_protectedItemsCount = If( json?.PropertyT("protectedItemsCount"), out var __jsonProtectedItemsCount) ? (int?)__jsonProtectedItemsCount : ProtectedItemsCount;} + {_protectedServersCount = If( json?.PropertyT("protectedServersCount"), out var __jsonProtectedServersCount) ? (int?)__jsonProtectedServersCount : ProtectedServersCount;} + {_diskCount = If( json?.PropertyT("diskCount"), out var __jsonDiskCount) ? (int?)__jsonDiskCount : DiskCount;} + {_usedDiskSpace = If( json?.PropertyT("usedDiskSpace"), out var __jsonUsedDiskSpace) ? (double?)__jsonUsedDiskSpace : UsedDiskSpace;} + {_availableDiskSpace = If( json?.PropertyT("availableDiskSpace"), out var __jsonAvailableDiskSpace) ? (double?)__jsonAvailableDiskSpace : AvailableDiskSpace;} + {_refreshedAt = If( json?.PropertyT("refreshedAt"), out var __jsonRefreshedAt) ? global::System.DateTime.TryParse((string)__jsonRefreshedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRefreshedAtValue) ? __jsonRefreshedAtValue : RefreshedAt : RefreshedAt;} + {_azureProtectedInstance = If( json?.PropertyT("azureProtectedInstances"), out var __jsonAzureProtectedInstances) ? (int?)__jsonAzureProtectedInstances : AzureProtectedInstance;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupEngineExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + AddIf( null != this._protectedItemsCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._protectedItemsCount) : null, "protectedItemsCount" ,container.Add ); + AddIf( null != this._protectedServersCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._protectedServersCount) : null, "protectedServersCount" ,container.Add ); + AddIf( null != this._diskCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._diskCount) : null, "diskCount" ,container.Add ); + AddIf( null != this._usedDiskSpace ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((double)this._usedDiskSpace) : null, "usedDiskSpace" ,container.Add ); + AddIf( null != this._availableDiskSpace ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((double)this._availableDiskSpace) : null, "availableDiskSpace" ,container.Add ); + AddIf( null != this._refreshedAt ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._refreshedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "refreshedAt" ,container.Add ); + AddIf( null != this._azureProtectedInstance ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._azureProtectedInstance) : null, "azureProtectedInstances" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsage.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsage.cs new file mode 100644 index 000000000000..a49839459159 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsage.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup management usages of a vault. + public partial class BackupManagementUsage : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsage, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsageInternal + { + + /// Backing field for property. + private long? _currentValue; + + /// Current value of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? CurrentValue { get => this._currentValue; set => this._currentValue = value; } + + /// Backing field for property. + private long? _limit; + + /// Limit of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? Limit { get => this._limit; set => this._limit = value; } + + /// Internal Acessors for Name + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsageInternal.Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NameInfo()); set { {_name = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfo _name; + + /// Name of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfo Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NameInfo()); set => this._name = value; } + + /// Localized value of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string NameLocalizedValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfoInternal)Name).LocalizedValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfoInternal)Name).LocalizedValue = value ?? null; } + + /// Value of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string NameValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfoInternal)Name).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfoInternal)Name).Value = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _nextResetTime; + + /// Next reset time of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? NextResetTime { get => this._nextResetTime; set => this._nextResetTime = value; } + + /// Backing field for property. + private string _quotaPeriod; + + /// Quota period of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string QuotaPeriod { get => this._quotaPeriod; set => this._quotaPeriod = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit? _unit; + + /// Unit of the usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit? Unit { get => this._unit; set => this._unit = value; } + + /// Creates an new instance. + public BackupManagementUsage() + { + + } + } + /// Backup management usages of a vault. + public partial interface IBackupManagementUsage : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Current value of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current value of usage.", + SerializedName = @"currentValue", + PossibleTypes = new [] { typeof(long) })] + long? CurrentValue { get; set; } + /// Limit of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Limit of usage.", + SerializedName = @"limit", + PossibleTypes = new [] { typeof(long) })] + long? Limit { get; set; } + /// Localized value of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Localized value of usage.", + SerializedName = @"localizedValue", + PossibleTypes = new [] { typeof(string) })] + string NameLocalizedValue { get; set; } + /// Value of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value of usage.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string NameValue { get; set; } + /// Next reset time of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next reset time of usage.", + SerializedName = @"nextResetTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? NextResetTime { get; set; } + /// Quota period of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Quota period of usage.", + SerializedName = @"quotaPeriod", + PossibleTypes = new [] { typeof(string) })] + string QuotaPeriod { get; set; } + /// Unit of the usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unit of the usage.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit? Unit { get; set; } + + } + /// Backup management usages of a vault. + internal partial interface IBackupManagementUsageInternal + + { + /// Current value of usage. + long? CurrentValue { get; set; } + /// Limit of usage. + long? Limit { get; set; } + /// Name of usage. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfo Name { get; set; } + /// Localized value of usage. + string NameLocalizedValue { get; set; } + /// Value of usage. + string NameValue { get; set; } + /// Next reset time of usage. + global::System.DateTime? NextResetTime { get; set; } + /// Quota period of usage. + string QuotaPeriod { get; set; } + /// Unit of the usage. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit? Unit { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsage.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsage.json.cs new file mode 100644 index 000000000000..99a1d68b3a43 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsage.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup management usages of a vault. + public partial class BackupManagementUsage + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupManagementUsage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NameInfo.FromJson(__jsonName) : Name;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + {_quotaPeriod = If( json?.PropertyT("quotaPeriod"), out var __jsonQuotaPeriod) ? (string)__jsonQuotaPeriod : (string)QuotaPeriod;} + {_nextResetTime = If( json?.PropertyT("nextResetTime"), out var __jsonNextResetTime) ? global::System.DateTime.TryParse((string)__jsonNextResetTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonNextResetTimeValue) ? __jsonNextResetTimeValue : NextResetTime : NextResetTime;} + {_currentValue = If( json?.PropertyT("currentValue"), out var __jsonCurrentValue) ? (long?)__jsonCurrentValue : CurrentValue;} + {_limit = If( json?.PropertyT("limit"), out var __jsonLimit) ? (long?)__jsonLimit : Limit;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsage. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsage. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsage FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupManagementUsage(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._name ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._name.ToJson(null,serializationMode) : null, "name" ,container.Add ); + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + AddIf( null != (((object)this._quotaPeriod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._quotaPeriod.ToString()) : null, "quotaPeriod" ,container.Add ); + AddIf( null != this._nextResetTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._nextResetTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "nextResetTime" ,container.Add ); + AddIf( null != this._currentValue ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._currentValue) : null, "currentValue" ,container.Add ); + AddIf( null != this._limit ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._limit) : null, "limit" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsageList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsageList.cs new file mode 100644 index 000000000000..7f0aa1e573d2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsageList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup management usage for vault. + public partial class BackupManagementUsageList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsageList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsageListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsage[] _value; + + /// The list of backup management usages for the given vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsage[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public BackupManagementUsageList() + { + + } + } + /// Backup management usage for vault. + public partial interface IBackupManagementUsageList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The list of backup management usages for the given vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of backup management usages for the given vault.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsage) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsage[] Value { get; set; } + + } + /// Backup management usage for vault. + internal partial interface IBackupManagementUsageListInternal + + { + /// The list of backup management usages for the given vault. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsage[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsageList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsageList.json.cs new file mode 100644 index 000000000000..f2586aba2d5b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupManagementUsageList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup management usage for vault. + public partial class BackupManagementUsageList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupManagementUsageList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsage) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupManagementUsage.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsageList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsageList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupManagementUsageList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupManagementUsageList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequest.cs new file mode 100644 index 000000000000..9810c85d93ee --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup request. Workload-specific backup requests are derived from this class. + /// + public partial class BackupRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal + { + + /// Backing field for property. + private string _objectType; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Creates an new instance. + public BackupRequest() + { + + } + } + /// Base class for backup request. Workload-specific backup requests are derived from this class. + public partial interface IBackupRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Base class for backup request. Workload-specific backup requests are derived from this class. + internal partial interface IBackupRequestInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequest.json.cs new file mode 100644 index 000000000000..ebeb0b16ad2e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup request. Workload-specific backup requests are derived from this class. + /// + public partial class BackupRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureFileShareBackupRequest": + { + return new AzureFileShareBackupRequest(json); + } + case "AzureWorkloadBackupRequest": + { + return new AzureWorkloadBackupRequest(json); + } + case "IaasVMBackupRequest": + { + return new IaasVMBackupRequest(json); + } + } + return new BackupRequest(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequestResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequestResource.cs new file mode 100644 index 000000000000..2b65174ad162 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequestResource.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup request. Workload-specific backup requests are derived from this class. + /// + public partial class BackupRequestResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupRequest()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal)Property).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal)Property).ObjectType = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest _property; + + /// BackupRequestResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupRequest()); set => this._property = value; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public BackupRequestResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Base class for backup request. Workload-specific backup requests are derived from this class. + public partial interface IBackupRequestResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Base class for backup request. Workload-specific backup requests are derived from this class. + internal partial interface IBackupRequestResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + /// BackupRequestResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequestResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequestResource.json.cs new file mode 100644 index 000000000000..89710de358ac --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupRequestResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup request. Workload-specific backup requests are derived from this class. + /// + public partial class BackupRequestResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupRequestResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupRequest.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupRequestResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfig.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfig.cs new file mode 100644 index 000000000000..a0581203a223 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfig.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource storage details. + public partial class BackupResourceConfig : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfig, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal + { + + /// Backing field for property. + private bool? _crossRegionRestoreFlag; + + /// Opt in details of Cross Region Restore feature. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? CrossRegionRestoreFlag { get => this._crossRegionRestoreFlag; set => this._crossRegionRestoreFlag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState? _dedupState; + + /// Vault Dedup state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState? DedupState { get => this._dedupState; set => this._dedupState = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? _storageModelType; + + /// Storage type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get => this._storageModelType; set => this._storageModelType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? _storageType; + + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get => this._storageType; set => this._storageType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? _storageTypeState; + + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get => this._storageTypeState; set => this._storageTypeState = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState? _xcoolState; + + /// Vault x-cool state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState? XcoolState { get => this._xcoolState; set => this._xcoolState = value; } + + /// Creates an new instance. + public BackupResourceConfig() + { + + } + } + /// The resource storage details. + public partial interface IBackupResourceConfig : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Opt in details of Cross Region Restore feature. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Opt in details of Cross Region Restore feature.", + SerializedName = @"crossRegionRestoreFlag", + PossibleTypes = new [] { typeof(bool) })] + bool? CrossRegionRestoreFlag { get; set; } + /// Vault Dedup state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Vault Dedup state", + SerializedName = @"dedupState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState? DedupState { get; set; } + /// Storage type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage type", + SerializedName = @"storageModelType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get; set; } + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage type.", + SerializedName = @"storageType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get; set; } + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked.", + SerializedName = @"storageTypeState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get; set; } + /// Vault x-cool state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Vault x-cool state", + SerializedName = @"xcoolState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState? XcoolState { get; set; } + + } + /// The resource storage details. + internal partial interface IBackupResourceConfigInternal + + { + /// Opt in details of Cross Region Restore feature. + bool? CrossRegionRestoreFlag { get; set; } + /// Vault Dedup state + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState? DedupState { get; set; } + /// Storage type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get; set; } + /// Storage type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get; set; } + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get; set; } + /// Vault x-cool state + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState? XcoolState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfig.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfig.json.cs new file mode 100644 index 000000000000..013851a00047 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfig.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource storage details. + public partial class BackupResourceConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupResourceConfig(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_storageModelType = If( json?.PropertyT("storageModelType"), out var __jsonStorageModelType) ? (string)__jsonStorageModelType : (string)StorageModelType;} + {_storageType = If( json?.PropertyT("storageType"), out var __jsonStorageType) ? (string)__jsonStorageType : (string)StorageType;} + {_storageTypeState = If( json?.PropertyT("storageTypeState"), out var __jsonStorageTypeState) ? (string)__jsonStorageTypeState : (string)StorageTypeState;} + {_crossRegionRestoreFlag = If( json?.PropertyT("crossRegionRestoreFlag"), out var __jsonCrossRegionRestoreFlag) ? (bool?)__jsonCrossRegionRestoreFlag : CrossRegionRestoreFlag;} + {_dedupState = If( json?.PropertyT("dedupState"), out var __jsonDedupState) ? (string)__jsonDedupState : (string)DedupState;} + {_xcoolState = If( json?.PropertyT("xcoolState"), out var __jsonXcoolState) ? (string)__jsonXcoolState : (string)XcoolState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupResourceConfig(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._storageModelType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._storageModelType.ToString()) : null, "storageModelType" ,container.Add ); + AddIf( null != (((object)this._storageType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._storageType.ToString()) : null, "storageType" ,container.Add ); + AddIf( null != (((object)this._storageTypeState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._storageTypeState.ToString()) : null, "storageTypeState" ,container.Add ); + AddIf( null != this._crossRegionRestoreFlag ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._crossRegionRestoreFlag) : null, "crossRegionRestoreFlag" ,container.Add ); + AddIf( null != (((object)this._dedupState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dedupState.ToString()) : null, "dedupState" ,container.Add ); + AddIf( null != (((object)this._xcoolState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._xcoolState.ToString()) : null, "xcoolState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfigResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfigResource.cs new file mode 100644 index 000000000000..71c3d0e5ed2a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfigResource.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource storage details. + public partial class BackupResourceConfigResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Opt in details of Cross Region Restore feature. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? CrossRegionRestoreFlag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).CrossRegionRestoreFlag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).CrossRegionRestoreFlag = value ?? default(bool); } + + /// Vault Dedup state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState? DedupState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).DedupState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).DedupState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState)""); } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfig Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceConfig()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfig _property; + + /// BackupResourceConfigResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfig Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceConfig()); set => this._property = value; } + + /// Storage type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).StorageModelType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).StorageModelType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType)""); } + + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).StorageType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).StorageType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType)""); } + + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).StorageTypeState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).StorageTypeState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Vault x-cool state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState? XcoolState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).XcoolState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigInternal)Property).XcoolState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState)""); } + + /// Creates an new instance. + public BackupResourceConfigResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The resource storage details. + public partial interface IBackupResourceConfigResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Opt in details of Cross Region Restore feature. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Opt in details of Cross Region Restore feature.", + SerializedName = @"crossRegionRestoreFlag", + PossibleTypes = new [] { typeof(bool) })] + bool? CrossRegionRestoreFlag { get; set; } + /// Vault Dedup state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Vault Dedup state", + SerializedName = @"dedupState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState? DedupState { get; set; } + /// Storage type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage type", + SerializedName = @"storageModelType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get; set; } + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage type.", + SerializedName = @"storageType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get; set; } + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked.", + SerializedName = @"storageTypeState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get; set; } + /// Vault x-cool state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Vault x-cool state", + SerializedName = @"xcoolState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState? XcoolState { get; set; } + + } + /// The resource storage details. + internal partial interface IBackupResourceConfigResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Opt in details of Cross Region Restore feature. + bool? CrossRegionRestoreFlag { get; set; } + /// Vault Dedup state + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState? DedupState { get; set; } + /// BackupResourceConfigResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfig Property { get; set; } + /// Storage type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get; set; } + /// Storage type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get; set; } + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get; set; } + /// Vault x-cool state + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState? XcoolState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfigResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfigResource.json.cs new file mode 100644 index 000000000000..78281de58a7a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceConfigResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource storage details. + public partial class BackupResourceConfigResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupResourceConfigResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceConfig.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupResourceConfigResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfig.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfig.cs new file mode 100644 index 000000000000..5310ecabbb49 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfig.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class BackupResourceEncryptionConfig : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfig, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? _encryptionAtRestType; + + /// Encryption At Rest Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? EncryptionAtRestType { get => this._encryptionAtRestType; set => this._encryptionAtRestType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? _infrastructureEncryptionState; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? InfrastructureEncryptionState { get => this._infrastructureEncryptionState; set => this._infrastructureEncryptionState = value; } + + /// Backing field for property. + private string _keyUri; + + /// Key Vault Key URI + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string KeyUri { get => this._keyUri; set => this._keyUri = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? _lastUpdateStatus; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? LastUpdateStatus { get => this._lastUpdateStatus; set => this._lastUpdateStatus = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Key Vault Subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Creates an new instance. + public BackupResourceEncryptionConfig() + { + + } + } + public partial interface IBackupResourceEncryptionConfig : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Encryption At Rest Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption At Rest Type", + SerializedName = @"encryptionAtRestType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? EncryptionAtRestType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"infrastructureEncryptionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? InfrastructureEncryptionState { get; set; } + /// Key Vault Key URI + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Vault Key URI", + SerializedName = @"keyUri", + PossibleTypes = new [] { typeof(string) })] + string KeyUri { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastUpdateStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? LastUpdateStatus { get; set; } + /// Key Vault Subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Vault Subscription Id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + } + internal partial interface IBackupResourceEncryptionConfigInternal + + { + /// Encryption At Rest Type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? EncryptionAtRestType { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? InfrastructureEncryptionState { get; set; } + /// Key Vault Key URI + string KeyUri { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? LastUpdateStatus { get; set; } + /// Key Vault Subscription Id + string SubscriptionId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfig.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfig.json.cs new file mode 100644 index 000000000000..210b6a5cc4d7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfig.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class BackupResourceEncryptionConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupResourceEncryptionConfig(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_encryptionAtRestType = If( json?.PropertyT("encryptionAtRestType"), out var __jsonEncryptionAtRestType) ? (string)__jsonEncryptionAtRestType : (string)EncryptionAtRestType;} + {_keyUri = If( json?.PropertyT("keyUri"), out var __jsonKeyUri) ? (string)__jsonKeyUri : (string)KeyUri;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_lastUpdateStatus = If( json?.PropertyT("lastUpdateStatus"), out var __jsonLastUpdateStatus) ? (string)__jsonLastUpdateStatus : (string)LastUpdateStatus;} + {_infrastructureEncryptionState = If( json?.PropertyT("infrastructureEncryptionState"), out var __jsonInfrastructureEncryptionState) ? (string)__jsonInfrastructureEncryptionState : (string)InfrastructureEncryptionState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupResourceEncryptionConfig(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._encryptionAtRestType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._encryptionAtRestType.ToString()) : null, "encryptionAtRestType" ,container.Add ); + AddIf( null != (((object)this._keyUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._keyUri.ToString()) : null, "keyUri" ,container.Add ); + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._lastUpdateStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastUpdateStatus.ToString()) : null, "lastUpdateStatus" ,container.Add ); + AddIf( null != (((object)this._infrastructureEncryptionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._infrastructureEncryptionState.ToString()) : null, "infrastructureEncryptionState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtended.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtended.cs new file mode 100644 index 000000000000..2d122b04bfcf --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtended.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class BackupResourceEncryptionConfigExtended : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtended, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfig __backupResourceEncryptionConfig = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceEncryptionConfig(); + + /// Encryption At Rest Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? EncryptionAtRestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)__backupResourceEncryptionConfig).EncryptionAtRestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)__backupResourceEncryptionConfig).EncryptionAtRestType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? InfrastructureEncryptionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)__backupResourceEncryptionConfig).InfrastructureEncryptionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)__backupResourceEncryptionConfig).InfrastructureEncryptionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState)""); } + + /// Key Vault Key URI + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string KeyUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)__backupResourceEncryptionConfig).KeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)__backupResourceEncryptionConfig).KeyUri = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? LastUpdateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)__backupResourceEncryptionConfig).LastUpdateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)__backupResourceEncryptionConfig).LastUpdateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus)""); } + + /// Key Vault Subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)__backupResourceEncryptionConfig).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)__backupResourceEncryptionConfig).SubscriptionId = value ?? null; } + + /// Backing field for property. + private bool? _useSystemAssignedIdentity; + + /// bool to indicate whether to use system Assigned Identity or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? UseSystemAssignedIdentity { get => this._useSystemAssignedIdentity; set => this._useSystemAssignedIdentity = value; } + + /// Backing field for property. + private string _userAssignedIdentity; + + /// User Assigned Identity Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string UserAssignedIdentity { get => this._userAssignedIdentity; set => this._userAssignedIdentity = value; } + + /// Creates an new instance. + public BackupResourceEncryptionConfigExtended() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__backupResourceEncryptionConfig), __backupResourceEncryptionConfig); + await eventListener.AssertObjectIsValid(nameof(__backupResourceEncryptionConfig), __backupResourceEncryptionConfig); + } + } + public partial interface IBackupResourceEncryptionConfigExtended : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfig + { + /// bool to indicate whether to use system Assigned Identity or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"bool to indicate whether to use system Assigned Identity or not", + SerializedName = @"useSystemAssignedIdentity", + PossibleTypes = new [] { typeof(bool) })] + bool? UseSystemAssignedIdentity { get; set; } + /// User Assigned Identity Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User Assigned Identity Id", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string UserAssignedIdentity { get; set; } + + } + internal partial interface IBackupResourceEncryptionConfigExtendedInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal + { + /// bool to indicate whether to use system Assigned Identity or not + bool? UseSystemAssignedIdentity { get; set; } + /// User Assigned Identity Id + string UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtended.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtended.json.cs new file mode 100644 index 000000000000..33664b024b05 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtended.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class BackupResourceEncryptionConfigExtended + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupResourceEncryptionConfigExtended(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __backupResourceEncryptionConfig = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceEncryptionConfig(json); + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentity"), out var __jsonUserAssignedIdentity) ? (string)__jsonUserAssignedIdentity : (string)UserAssignedIdentity;} + {_useSystemAssignedIdentity = If( json?.PropertyT("useSystemAssignedIdentity"), out var __jsonUseSystemAssignedIdentity) ? (bool?)__jsonUseSystemAssignedIdentity : UseSystemAssignedIdentity;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtended. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtended. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtended FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupResourceEncryptionConfigExtended(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __backupResourceEncryptionConfig?.ToJson(container, serializationMode); + AddIf( null != (((object)this._userAssignedIdentity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._userAssignedIdentity.ToString()) : null, "userAssignedIdentity" ,container.Add ); + AddIf( null != this._useSystemAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._useSystemAssignedIdentity) : null, "useSystemAssignedIdentity" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtendedResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtendedResource.cs new file mode 100644 index 000000000000..6a6925c8b157 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtendedResource.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class BackupResourceEncryptionConfigExtendedResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Encryption At Rest Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? EncryptionAtRestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).EncryptionAtRestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).EncryptionAtRestType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType)""); } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? InfrastructureEncryptionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).InfrastructureEncryptionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).InfrastructureEncryptionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState)""); } + + /// Key Vault Key URI + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string KeyUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).KeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).KeyUri = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? LastUpdateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).LastUpdateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).LastUpdateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus)""); } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtended Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceEncryptionConfigExtended()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtended _property; + + /// BackupResourceEncryptionConfigExtendedResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtended Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceEncryptionConfigExtended()); set => this._property = value; } + + /// Key Vault Subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).SubscriptionId = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// bool to indicate whether to use system Assigned Identity or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? UseSystemAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedInternal)Property).UseSystemAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedInternal)Property).UseSystemAssignedIdentity = value ?? default(bool); } + + /// User Assigned Identity Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string UserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedInternal)Property).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedInternal)Property).UserAssignedIdentity = value ?? null; } + + /// + /// Creates an new instance. + /// + public BackupResourceEncryptionConfigExtendedResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + public partial interface IBackupResourceEncryptionConfigExtendedResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Encryption At Rest Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption At Rest Type", + SerializedName = @"encryptionAtRestType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? EncryptionAtRestType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"infrastructureEncryptionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? InfrastructureEncryptionState { get; set; } + /// Key Vault Key URI + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Vault Key URI", + SerializedName = @"keyUri", + PossibleTypes = new [] { typeof(string) })] + string KeyUri { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastUpdateStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? LastUpdateStatus { get; set; } + /// Key Vault Subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Vault Subscription Id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// bool to indicate whether to use system Assigned Identity or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"bool to indicate whether to use system Assigned Identity or not", + SerializedName = @"useSystemAssignedIdentity", + PossibleTypes = new [] { typeof(bool) })] + bool? UseSystemAssignedIdentity { get; set; } + /// User Assigned Identity Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User Assigned Identity Id", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string UserAssignedIdentity { get; set; } + + } + internal partial interface IBackupResourceEncryptionConfigExtendedResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Encryption At Rest Type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? EncryptionAtRestType { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? InfrastructureEncryptionState { get; set; } + /// Key Vault Key URI + string KeyUri { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? LastUpdateStatus { get; set; } + /// BackupResourceEncryptionConfigExtendedResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtended Property { get; set; } + /// Key Vault Subscription Id + string SubscriptionId { get; set; } + /// bool to indicate whether to use system Assigned Identity or not + bool? UseSystemAssignedIdentity { get; set; } + /// User Assigned Identity Id + string UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtendedResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtendedResource.json.cs new file mode 100644 index 000000000000..444f89ecc967 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigExtendedResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class BackupResourceEncryptionConfigExtendedResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupResourceEncryptionConfigExtendedResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceEncryptionConfigExtended.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigExtendedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupResourceEncryptionConfigExtendedResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigResource.cs new file mode 100644 index 000000000000..1b9e6765510e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigResource.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class BackupResourceEncryptionConfigResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Encryption At Rest Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? EncryptionAtRestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).EncryptionAtRestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).EncryptionAtRestType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType)""); } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? InfrastructureEncryptionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).InfrastructureEncryptionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).InfrastructureEncryptionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState)""); } + + /// Key Vault Key URI + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string KeyUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).KeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).KeyUri = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? LastUpdateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).LastUpdateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).LastUpdateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus)""); } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfig Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceEncryptionConfig()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfig _property; + + /// BackupResourceEncryptionConfigResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfig Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceEncryptionConfig()); set => this._property = value; } + + /// Key Vault Subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigInternal)Property).SubscriptionId = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public BackupResourceEncryptionConfigResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + public partial interface IBackupResourceEncryptionConfigResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Encryption At Rest Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption At Rest Type", + SerializedName = @"encryptionAtRestType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? EncryptionAtRestType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"infrastructureEncryptionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? InfrastructureEncryptionState { get; set; } + /// Key Vault Key URI + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Vault Key URI", + SerializedName = @"keyUri", + PossibleTypes = new [] { typeof(string) })] + string KeyUri { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastUpdateStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? LastUpdateStatus { get; set; } + /// Key Vault Subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Vault Subscription Id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + } + internal partial interface IBackupResourceEncryptionConfigResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Encryption At Rest Type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType? EncryptionAtRestType { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState? InfrastructureEncryptionState { get; set; } + /// Key Vault Key URI + string KeyUri { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus? LastUpdateStatus { get; set; } + /// BackupResourceEncryptionConfigResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfig Property { get; set; } + /// Key Vault Subscription Id + string SubscriptionId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigResource.json.cs new file mode 100644 index 000000000000..e2a7bf767a41 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceEncryptionConfigResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class BackupResourceEncryptionConfigResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupResourceEncryptionConfigResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceEncryptionConfig.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupResourceEncryptionConfigResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfig.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfig.cs new file mode 100644 index 000000000000..8babc6a1f4c7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfig.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup resource vault config details. + public partial class BackupResourceVaultConfig : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfig, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState? _enhancedSecurityState; + + /// Enabled or Disabled. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState? EnhancedSecurityState { get => this._enhancedSecurityState; set => this._enhancedSecurityState = value; } + + /// Backing field for property. + private bool? _isSoftDeleteFeatureStateEditable; + + /// Is soft delete feature state editable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsSoftDeleteFeatureStateEditable { get => this._isSoftDeleteFeatureStateEditable; set => this._isSoftDeleteFeatureStateEditable = value; } + + /// Backing field for property. + private string[] _resourceGuardOperationRequest; + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] ResourceGuardOperationRequest { get => this._resourceGuardOperationRequest; set => this._resourceGuardOperationRequest = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState? _softDeleteFeatureState; + + /// Soft Delete feature state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState? SoftDeleteFeatureState { get => this._softDeleteFeatureState; set => this._softDeleteFeatureState = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? _storageModelType; + + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get => this._storageModelType; set => this._storageModelType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? _storageType; + + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get => this._storageType; set => this._storageType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? _storageTypeState; + + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get => this._storageTypeState; set => this._storageTypeState = value; } + + /// Creates an new instance. + public BackupResourceVaultConfig() + { + + } + } + /// Backup resource vault config details. + public partial interface IBackupResourceVaultConfig : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Enabled or Disabled. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enabled or Disabled.", + SerializedName = @"enhancedSecurityState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState? EnhancedSecurityState { get; set; } + /// Is soft delete feature state editable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Is soft delete feature state editable", + SerializedName = @"isSoftDeleteFeatureStateEditable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSoftDeleteFeatureStateEditable { get; set; } + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ResourceGuard Operation Requests", + SerializedName = @"resourceGuardOperationRequests", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceGuardOperationRequest { get; set; } + /// Soft Delete feature state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Soft Delete feature state", + SerializedName = @"softDeleteFeatureState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState? SoftDeleteFeatureState { get; set; } + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage type.", + SerializedName = @"storageModelType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get; set; } + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage type.", + SerializedName = @"storageType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get; set; } + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked.", + SerializedName = @"storageTypeState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get; set; } + + } + /// Backup resource vault config details. + internal partial interface IBackupResourceVaultConfigInternal + + { + /// Enabled or Disabled. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState? EnhancedSecurityState { get; set; } + /// Is soft delete feature state editable + bool? IsSoftDeleteFeatureStateEditable { get; set; } + /// ResourceGuard Operation Requests + string[] ResourceGuardOperationRequest { get; set; } + /// Soft Delete feature state + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState? SoftDeleteFeatureState { get; set; } + /// Storage type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get; set; } + /// Storage type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get; set; } + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfig.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfig.json.cs new file mode 100644 index 000000000000..c9e7d0bf948b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfig.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup resource vault config details. + public partial class BackupResourceVaultConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupResourceVaultConfig(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_storageModelType = If( json?.PropertyT("storageModelType"), out var __jsonStorageModelType) ? (string)__jsonStorageModelType : (string)StorageModelType;} + {_storageType = If( json?.PropertyT("storageType"), out var __jsonStorageType) ? (string)__jsonStorageType : (string)StorageType;} + {_storageTypeState = If( json?.PropertyT("storageTypeState"), out var __jsonStorageTypeState) ? (string)__jsonStorageTypeState : (string)StorageTypeState;} + {_enhancedSecurityState = If( json?.PropertyT("enhancedSecurityState"), out var __jsonEnhancedSecurityState) ? (string)__jsonEnhancedSecurityState : (string)EnhancedSecurityState;} + {_softDeleteFeatureState = If( json?.PropertyT("softDeleteFeatureState"), out var __jsonSoftDeleteFeatureState) ? (string)__jsonSoftDeleteFeatureState : (string)SoftDeleteFeatureState;} + {_resourceGuardOperationRequest = If( json?.PropertyT("resourceGuardOperationRequests"), out var __jsonResourceGuardOperationRequests) ? If( __jsonResourceGuardOperationRequests as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ResourceGuardOperationRequest;} + {_isSoftDeleteFeatureStateEditable = If( json?.PropertyT("isSoftDeleteFeatureStateEditable"), out var __jsonIsSoftDeleteFeatureStateEditable) ? (bool?)__jsonIsSoftDeleteFeatureStateEditable : IsSoftDeleteFeatureStateEditable;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupResourceVaultConfig(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._storageModelType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._storageModelType.ToString()) : null, "storageModelType" ,container.Add ); + AddIf( null != (((object)this._storageType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._storageType.ToString()) : null, "storageType" ,container.Add ); + AddIf( null != (((object)this._storageTypeState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._storageTypeState.ToString()) : null, "storageTypeState" ,container.Add ); + AddIf( null != (((object)this._enhancedSecurityState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._enhancedSecurityState.ToString()) : null, "enhancedSecurityState" ,container.Add ); + AddIf( null != (((object)this._softDeleteFeatureState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._softDeleteFeatureState.ToString()) : null, "softDeleteFeatureState" ,container.Add ); + if (null != this._resourceGuardOperationRequest) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._resourceGuardOperationRequest ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("resourceGuardOperationRequests",__w); + } + AddIf( null != this._isSoftDeleteFeatureStateEditable ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isSoftDeleteFeatureStateEditable) : null, "isSoftDeleteFeatureStateEditable" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfigResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfigResource.cs new file mode 100644 index 000000000000..d2b928647db1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfigResource.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup resource vault config details. + public partial class BackupResourceVaultConfigResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Enabled or Disabled. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState? EnhancedSecurityState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).EnhancedSecurityState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).EnhancedSecurityState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState)""); } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Is soft delete feature state editable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? IsSoftDeleteFeatureStateEditable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).IsSoftDeleteFeatureStateEditable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).IsSoftDeleteFeatureStateEditable = value ?? default(bool); } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfig Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceVaultConfig()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfig _property; + + /// BackupResourceVaultConfigResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfig Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceVaultConfig()); set => this._property = value; } + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Soft Delete feature state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState? SoftDeleteFeatureState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).SoftDeleteFeatureState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).SoftDeleteFeatureState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState)""); } + + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).StorageModelType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).StorageModelType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType)""); } + + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).StorageType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).StorageType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType)""); } + + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).StorageTypeState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigInternal)Property).StorageTypeState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public BackupResourceVaultConfigResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Backup resource vault config details. + public partial interface IBackupResourceVaultConfigResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Enabled or Disabled. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enabled or Disabled.", + SerializedName = @"enhancedSecurityState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState? EnhancedSecurityState { get; set; } + /// Is soft delete feature state editable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Is soft delete feature state editable", + SerializedName = @"isSoftDeleteFeatureStateEditable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSoftDeleteFeatureStateEditable { get; set; } + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ResourceGuard Operation Requests", + SerializedName = @"resourceGuardOperationRequests", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceGuardOperationRequest { get; set; } + /// Soft Delete feature state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Soft Delete feature state", + SerializedName = @"softDeleteFeatureState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState? SoftDeleteFeatureState { get; set; } + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage type.", + SerializedName = @"storageModelType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get; set; } + /// Storage type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage type.", + SerializedName = @"storageType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get; set; } + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked.", + SerializedName = @"storageTypeState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get; set; } + + } + /// Backup resource vault config details. + internal partial interface IBackupResourceVaultConfigResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Enabled or Disabled. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState? EnhancedSecurityState { get; set; } + /// Is soft delete feature state editable + bool? IsSoftDeleteFeatureStateEditable { get; set; } + /// BackupResourceVaultConfigResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfig Property { get; set; } + /// ResourceGuard Operation Requests + string[] ResourceGuardOperationRequest { get; set; } + /// Soft Delete feature state + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState? SoftDeleteFeatureState { get; set; } + /// Storage type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageModelType { get; set; } + /// Storage type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType? StorageType { get; set; } + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState? StorageTypeState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfigResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfigResource.json.cs new file mode 100644 index 000000000000..f60e3df25841 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupResourceVaultConfigResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup resource vault config details. + public partial class BackupResourceVaultConfigResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupResourceVaultConfigResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceVaultConfig.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupResourceVaultConfigResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusRequest.cs new file mode 100644 index 000000000000..fe0c491e254d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// BackupStatus request. + public partial class BackupStatusRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusRequestInternal + { + + /// Backing field for property. + private string _poLogicalName; + + /// Protectable Item Logical Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PoLogicalName { get => this._poLogicalName; set => this._poLogicalName = value; } + + /// Backing field for property. + private string _resourceId; + + /// Entire ARM resource id of the resource + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? _resourceType; + + /// Container Type - VM, SQLPaaS, DPM, AzureFileShare... + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? ResourceType { get => this._resourceType; set => this._resourceType = value; } + + /// Creates an new instance. + public BackupStatusRequest() + { + + } + } + /// BackupStatus request. + public partial interface IBackupStatusRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Protectable Item Logical Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protectable Item Logical Name", + SerializedName = @"poLogicalName", + PossibleTypes = new [] { typeof(string) })] + string PoLogicalName { get; set; } + /// Entire ARM resource id of the resource + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Entire ARM resource id of the resource", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// Container Type - VM, SQLPaaS, DPM, AzureFileShare... + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container Type - VM, SQLPaaS, DPM, AzureFileShare...", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? ResourceType { get; set; } + + } + /// BackupStatus request. + internal partial interface IBackupStatusRequestInternal + + { + /// Protectable Item Logical Name + string PoLogicalName { get; set; } + /// Entire ARM resource id of the resource + string ResourceId { get; set; } + /// Container Type - VM, SQLPaaS, DPM, AzureFileShare... + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? ResourceType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusRequest.json.cs new file mode 100644 index 000000000000..4dc8e07066be --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// BackupStatus request. + public partial class BackupStatusRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupStatusRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_poLogicalName = If( json?.PropertyT("poLogicalName"), out var __jsonPoLogicalName) ? (string)__jsonPoLogicalName : (string)PoLogicalName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupStatusRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != (((object)this._poLogicalName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._poLogicalName.ToString()) : null, "poLogicalName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusResponse.cs new file mode 100644 index 000000000000..665c70fab7bc --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusResponse.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// BackupStatus response. + public partial class BackupStatusResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusResponseInternal + { + + /// Backing field for property. + private string _containerName; + + /// + /// Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private string _errorCode; + + /// ErrorCode in case of intent failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorCode { get => this._errorCode; set => this._errorCode = value; } + + /// Backing field for property. + private string _errorMessage; + + /// ErrorMessage in case of intent failed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorMessage { get => this._errorMessage; set => this._errorMessage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName? _fabricName; + + /// Specifies the fabric name - Azure or AD + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName? FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// Backing field for property. + private string _policyName; + + /// Specifies the policy name which is used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyName { get => this._policyName; set => this._policyName = value; } + + /// Backing field for property. + private string _protectedItemName; + + /// Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectedItemName { get => this._protectedItemName; set => this._protectedItemName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? _protectionStatus; + + /// Specifies whether the container is registered or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionStatus { get => this._protectionStatus; set => this._protectionStatus = value; } + + /// Backing field for property. + private string _registrationStatus; + + /// Container registration status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RegistrationStatus { get => this._registrationStatus; set => this._registrationStatus = value; } + + /// Backing field for property. + private string _vaultId; + + /// Specifies the arm resource id of the vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VaultId { get => this._vaultId; set => this._vaultId = value; } + + /// Creates an new instance. + public BackupStatusResponse() + { + + } + } + /// BackupStatus response. + public partial interface IBackupStatusResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// ErrorCode in case of intent failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ErrorCode in case of intent failed", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(string) })] + string ErrorCode { get; set; } + /// ErrorMessage in case of intent failed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ErrorMessage in case of intent failed.", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorMessage { get; set; } + /// Specifies the fabric name - Azure or AD + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the fabric name - Azure or AD", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName? FabricName { get; set; } + /// Specifies the policy name which is used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the policy name which is used for protection", + SerializedName = @"policyName", + PossibleTypes = new [] { typeof(string) })] + string PolicyName { get; set; } + /// Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname.", + SerializedName = @"protectedItemName", + PossibleTypes = new [] { typeof(string) })] + string ProtectedItemName { get; set; } + /// Specifies whether the container is registered or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether the container is registered or not", + SerializedName = @"protectionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionStatus { get; set; } + /// Container registration status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container registration status", + SerializedName = @"registrationStatus", + PossibleTypes = new [] { typeof(string) })] + string RegistrationStatus { get; set; } + /// Specifies the arm resource id of the vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the arm resource id of the vault", + SerializedName = @"vaultId", + PossibleTypes = new [] { typeof(string) })] + string VaultId { get; set; } + + } + /// BackupStatus response. + internal partial interface IBackupStatusResponseInternal + + { + /// + /// Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. + /// + string ContainerName { get; set; } + /// ErrorCode in case of intent failed + string ErrorCode { get; set; } + /// ErrorMessage in case of intent failed. + string ErrorMessage { get; set; } + /// Specifies the fabric name - Azure or AD + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName? FabricName { get; set; } + /// Specifies the policy name which is used for protection + string PolicyName { get; set; } + /// Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. + string ProtectedItemName { get; set; } + /// Specifies whether the container is registered or not + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionStatus { get; set; } + /// Container registration status + string RegistrationStatus { get; set; } + /// Specifies the arm resource id of the vault + string VaultId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusResponse.json.cs new file mode 100644 index 000000000000..84f5cba781e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BackupStatusResponse.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// BackupStatus response. + public partial class BackupStatusResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BackupStatusResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_protectionStatus = If( json?.PropertyT("protectionStatus"), out var __jsonProtectionStatus) ? (string)__jsonProtectionStatus : (string)ProtectionStatus;} + {_vaultId = If( json?.PropertyT("vaultId"), out var __jsonVaultId) ? (string)__jsonVaultId : (string)VaultId;} + {_fabricName = If( json?.PropertyT("fabricName"), out var __jsonFabricName) ? (string)__jsonFabricName : (string)FabricName;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_protectedItemName = If( json?.PropertyT("protectedItemName"), out var __jsonProtectedItemName) ? (string)__jsonProtectedItemName : (string)ProtectedItemName;} + {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (string)__jsonErrorCode : (string)ErrorCode;} + {_errorMessage = If( json?.PropertyT("errorMessage"), out var __jsonErrorMessage) ? (string)__jsonErrorMessage : (string)ErrorMessage;} + {_policyName = If( json?.PropertyT("policyName"), out var __jsonPolicyName) ? (string)__jsonPolicyName : (string)PolicyName;} + {_registrationStatus = If( json?.PropertyT("registrationStatus"), out var __jsonRegistrationStatus) ? (string)__jsonRegistrationStatus : (string)RegistrationStatus;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BackupStatusResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._protectionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionStatus.ToString()) : null, "protectionStatus" ,container.Add ); + AddIf( null != (((object)this._vaultId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._vaultId.ToString()) : null, "vaultId" ,container.Add ); + AddIf( null != (((object)this._fabricName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._fabricName.ToString()) : null, "fabricName" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._protectedItemName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectedItemName.ToString()) : null, "protectedItemName" ,container.Add ); + AddIf( null != (((object)this._errorCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorCode.ToString()) : null, "errorCode" ,container.Add ); + AddIf( null != (((object)this._errorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorMessage.ToString()) : null, "errorMessage" ,container.Add ); + AddIf( null != (((object)this._policyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyName.ToString()) : null, "policyName" ,container.Add ); + AddIf( null != (((object)this._registrationStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._registrationStatus.ToString()) : null, "registrationStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BekDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BekDetails.cs new file mode 100644 index 000000000000..d4f2ffcb0541 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BekDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// BEK is bitlocker encryption key. + public partial class BekDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetailsInternal + { + + /// Backing field for property. + private string _secretData; + + /// BEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SecretData { get => this._secretData; set => this._secretData = value; } + + /// Backing field for property. + private string _secretUrl; + + /// Secret is BEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SecretUrl { get => this._secretUrl; set => this._secretUrl = value; } + + /// Backing field for property. + private string _secretVaultId; + + /// ID of the Key Vault where this Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SecretVaultId { get => this._secretVaultId; set => this._secretVaultId = value; } + + /// Creates an new instance. + public BekDetails() + { + + } + } + /// BEK is bitlocker encryption key. + public partial interface IBekDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// BEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"BEK data.", + SerializedName = @"secretData", + PossibleTypes = new [] { typeof(string) })] + string SecretData { get; set; } + /// Secret is BEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secret is BEK.", + SerializedName = @"secretUrl", + PossibleTypes = new [] { typeof(string) })] + string SecretUrl { get; set; } + /// ID of the Key Vault where this Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the Key Vault where this Secret is stored.", + SerializedName = @"secretVaultId", + PossibleTypes = new [] { typeof(string) })] + string SecretVaultId { get; set; } + + } + /// BEK is bitlocker encryption key. + internal partial interface IBekDetailsInternal + + { + /// BEK data. + string SecretData { get; set; } + /// Secret is BEK. + string SecretUrl { get; set; } + /// ID of the Key Vault where this Secret is stored. + string SecretVaultId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BekDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BekDetails.json.cs new file mode 100644 index 000000000000..ffd07139d5f8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BekDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// BEK is bitlocker encryption key. + public partial class BekDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BekDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_secretUrl = If( json?.PropertyT("secretUrl"), out var __jsonSecretUrl) ? (string)__jsonSecretUrl : (string)SecretUrl;} + {_secretVaultId = If( json?.PropertyT("secretVaultId"), out var __jsonSecretVaultId) ? (string)__jsonSecretVaultId : (string)SecretVaultId;} + {_secretData = If( json?.PropertyT("secretData"), out var __jsonSecretData) ? (string)__jsonSecretData : (string)SecretData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BekDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._secretUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._secretUrl.ToString()) : null, "secretUrl" ,container.Add ); + AddIf( null != (((object)this._secretVaultId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._secretVaultId.ToString()) : null, "secretVaultId" ,container.Add ); + AddIf( null != (((object)this._secretData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._secretData.ToString()) : null, "secretData" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEngineQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEngineQueryObject.cs new file mode 100644 index 000000000000..31b59f8bd004 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Query parameters to fetch list of backup engines. + public partial class BmsBackupEngineQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupEngineQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupEngineQueryObjectInternal + { + + /// Backing field for property. + private string _expand; + + /// attribute to add extended info + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Creates an new instance. + public BmsBackupEngineQueryObject() + { + + } + } + /// Query parameters to fetch list of backup engines. + public partial interface IBmsBackupEngineQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// attribute to add extended info + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"attribute to add extended info", + SerializedName = @"expand", + PossibleTypes = new [] { typeof(string) })] + string Expand { get; set; } + + } + /// Query parameters to fetch list of backup engines. + internal partial interface IBmsBackupEngineQueryObjectInternal + + { + /// attribute to add extended info + string Expand { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEngineQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEngineQueryObject.json.cs new file mode 100644 index 000000000000..9ad135c06fc4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEngineQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Query parameters to fetch list of backup engines. + public partial class BmsBackupEngineQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BmsBackupEngineQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_expand = If( json?.PropertyT("expand"), out var __jsonExpand) ? (string)__jsonExpand : (string)Expand;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupEngineQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupEngineQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupEngineQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BmsBackupEngineQueryObject(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._expand)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._expand.ToString()) : null, "expand" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEnginesQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEnginesQueryObject.cs new file mode 100644 index 000000000000..9d1e67c2db67 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEnginesQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Query parameters to fetch list of backup engines. + public partial class BmsBackupEnginesQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupEnginesQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupEnginesQueryObjectInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Backup management type for the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private string _expand; + + /// Attribute to add extended info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Creates an new instance. + public BmsBackupEnginesQueryObject() + { + + } + } + /// Query parameters to fetch list of backup engines. + public partial interface IBmsBackupEnginesQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup management type for the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type for the backup engine.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Attribute to add extended info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Attribute to add extended info.", + SerializedName = @"expand", + PossibleTypes = new [] { typeof(string) })] + string Expand { get; set; } + /// Friendly name of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the backup engine.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + + } + /// Query parameters to fetch list of backup engines. + internal partial interface IBmsBackupEnginesQueryObjectInternal + + { + /// Backup management type for the backup engine. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Attribute to add extended info. + string Expand { get; set; } + /// Friendly name of the backup engine. + string FriendlyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEnginesQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEnginesQueryObject.json.cs new file mode 100644 index 000000000000..9ebf1ba18225 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupEnginesQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Query parameters to fetch list of backup engines. + public partial class BmsBackupEnginesQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BmsBackupEnginesQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_expand = If( json?.PropertyT("expand"), out var __jsonExpand) ? (string)__jsonExpand : (string)Expand;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupEnginesQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupEnginesQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupEnginesQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BmsBackupEnginesQueryObject(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._expand)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._expand.ToString()) : null, "expand" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupSummariesQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupSummariesQueryObject.cs new file mode 100644 index 000000000000..6005049d90b3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupSummariesQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Query parameters to fetch backup summaries. + public partial class BmsBackupSummariesQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupSummariesQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupSummariesQueryObjectInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type? _type; + + /// Backup management type for this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public BmsBackupSummariesQueryObject() + { + + } + } + /// Query parameters to fetch backup summaries. + public partial interface IBmsBackupSummariesQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup management type for this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type for this container.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type? Type { get; set; } + + } + /// Query parameters to fetch backup summaries. + internal partial interface IBmsBackupSummariesQueryObjectInternal + + { + /// Backup management type for this container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupSummariesQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupSummariesQueryObject.json.cs new file mode 100644 index 000000000000..af32384f5952 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsBackupSummariesQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Query parameters to fetch backup summaries. + public partial class BmsBackupSummariesQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BmsBackupSummariesQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupSummariesQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupSummariesQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsBackupSummariesQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BmsBackupSummariesQueryObject(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainerQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainerQueryObject.cs new file mode 100644 index 000000000000..b8266014d305 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainerQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The query filters that can be used with the list containers API. + public partial class BmsContainerQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsContainerQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsContainerQueryObjectInternal + { + + /// Backing field for property. + private string _backupEngineName; + + /// Backup engine name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupEngineName { get => this._backupEngineName; set => this._backupEngineName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType _backupManagementType; + + /// Backup management type for this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType? _containerType; + + /// Type of container for filter + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType? ContainerType { get => this._containerType; set => this._containerType = value; } + + /// Backing field for property. + private string _fabricName; + + /// Fabric name for filter + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Backing field for property. + private string _status; + + /// Status of registration of this container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public BmsContainerQueryObject() + { + + } + } + /// The query filters that can be used with the list containers API. + public partial interface IBmsContainerQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup engine name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup engine name", + SerializedName = @"backupEngineName", + PossibleTypes = new [] { typeof(string) })] + string BackupEngineName { get; set; } + /// Backup management type for this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Backup management type for this container.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType BackupManagementType { get; set; } + /// Type of container for filter + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of container for filter", + SerializedName = @"containerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType? ContainerType { get; set; } + /// Fabric name for filter + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fabric name for filter", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + string FabricName { get; set; } + /// Friendly name of this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of this container.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Status of registration of this container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of registration of this container with the Recovery Services Vault.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + + } + /// The query filters that can be used with the list containers API. + internal partial interface IBmsContainerQueryObjectInternal + + { + /// Backup engine name + string BackupEngineName { get; set; } + /// Backup management type for this container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType BackupManagementType { get; set; } + /// Type of container for filter + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType? ContainerType { get; set; } + /// Fabric name for filter + string FabricName { get; set; } + /// Friendly name of this container. + string FriendlyName { get; set; } + /// Status of registration of this container with the Recovery Services Vault. + string Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainerQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainerQueryObject.json.cs new file mode 100644 index 000000000000..5d8500d431d4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainerQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The query filters that can be used with the list containers API. + public partial class BmsContainerQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BmsContainerQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_containerType = If( json?.PropertyT("containerType"), out var __jsonContainerType) ? (string)__jsonContainerType : (string)ContainerType;} + {_backupEngineName = If( json?.PropertyT("backupEngineName"), out var __jsonBackupEngineName) ? (string)__jsonBackupEngineName : (string)BackupEngineName;} + {_fabricName = If( json?.PropertyT("fabricName"), out var __jsonFabricName) ? (string)__jsonFabricName : (string)FabricName;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsContainerQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsContainerQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsContainerQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BmsContainerQueryObject(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._containerType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerType.ToString()) : null, "containerType" ,container.Add ); + AddIf( null != (((object)this._backupEngineName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupEngineName.ToString()) : null, "backupEngineName" ,container.Add ); + AddIf( null != (((object)this._fabricName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._fabricName.ToString()) : null, "fabricName" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainersInquiryQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainersInquiryQueryObject.cs new file mode 100644 index 000000000000..46f1918d366f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainersInquiryQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The query filters that can be used with the inquire container API. + public partial class BmsContainersInquiryQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsContainersInquiryQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsContainersInquiryQueryObjectInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Backup management type for this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? _workloadType; + + /// Workload type for this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public BmsContainersInquiryQueryObject() + { + + } + } + /// The query filters that can be used with the inquire container API. + public partial interface IBmsContainersInquiryQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup management type for this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type for this container.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Workload type for this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload type for this container.", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } + /// The query filters that can be used with the inquire container API. + internal partial interface IBmsContainersInquiryQueryObjectInternal + + { + /// Backup management type for this container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Workload type for this container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainersInquiryQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainersInquiryQueryObject.json.cs new file mode 100644 index 000000000000..b048512e7d08 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsContainersInquiryQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The query filters that can be used with the inquire container API. + public partial class BmsContainersInquiryQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BmsContainersInquiryQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsContainersInquiryQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsContainersInquiryQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsContainersInquiryQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BmsContainersInquiryQueryObject(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsRefreshContainersQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsRefreshContainersQueryObject.cs new file mode 100644 index 000000000000..525ebb61e5a4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsRefreshContainersQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The query filters that can be used with the refresh container API. + public partial class BmsRefreshContainersQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsRefreshContainersQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsRefreshContainersQueryObjectInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Backup management type for this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Creates an new instance. + public BmsRefreshContainersQueryObject() + { + + } + } + /// The query filters that can be used with the refresh container API. + public partial interface IBmsRefreshContainersQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup management type for this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type for this container.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + + } + /// The query filters that can be used with the refresh container API. + internal partial interface IBmsRefreshContainersQueryObjectInternal + + { + /// Backup management type for this container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsRefreshContainersQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsRefreshContainersQueryObject.json.cs new file mode 100644 index 000000000000..2aa6f2d4da0b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsRefreshContainersQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The query filters that can be used with the refresh container API. + public partial class BmsRefreshContainersQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BmsRefreshContainersQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsRefreshContainersQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsRefreshContainersQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsRefreshContainersQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BmsRefreshContainersQueryObject(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsWorkloadItemQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsWorkloadItemQueryObject.cs new file mode 100644 index 000000000000..97efa61f7b65 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsWorkloadItemQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list items that can be backed up. + public partial class BmsWorkloadItemQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsWorkloadItemQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsWorkloadItemQueryObjectInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Backup management type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? _protectionStatus; + + /// Backup status query parameter. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionStatus { get => this._protectionStatus; set => this._protectionStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType? _workloadItemType; + + /// Workload Item type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType? WorkloadItemType { get => this._workloadItemType; set => this._workloadItemType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? _workloadType; + + /// Workload type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public BmsWorkloadItemQueryObject() + { + + } + } + /// Filters to list items that can be backed up. + public partial interface IBmsWorkloadItemQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup management type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Backup status query parameter. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup status query parameter.", + SerializedName = @"protectionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionStatus { get; set; } + /// Workload Item type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload Item type", + SerializedName = @"workloadItemType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType? WorkloadItemType { get; set; } + /// Workload type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload type", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } + /// Filters to list items that can be backed up. + internal partial interface IBmsWorkloadItemQueryObjectInternal + + { + /// Backup management type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Backup status query parameter. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionStatus { get; set; } + /// Workload Item type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType? WorkloadItemType { get; set; } + /// Workload type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsWorkloadItemQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsWorkloadItemQueryObject.json.cs new file mode 100644 index 000000000000..734f6b52331e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsWorkloadItemQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list items that can be backed up. + public partial class BmsWorkloadItemQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BmsWorkloadItemQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_workloadItemType = If( json?.PropertyT("workloadItemType"), out var __jsonWorkloadItemType) ? (string)__jsonWorkloadItemType : (string)WorkloadItemType;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + {_protectionStatus = If( json?.PropertyT("protectionStatus"), out var __jsonProtectionStatus) ? (string)__jsonProtectionStatus : (string)ProtectionStatus;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsWorkloadItemQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsWorkloadItemQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsWorkloadItemQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BmsWorkloadItemQueryObject(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._workloadItemType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadItemType.ToString()) : null, "workloadItemType" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + AddIf( null != (((object)this._protectionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionStatus.ToString()) : null, "protectionStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmspoQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmspoQueryObject.cs new file mode 100644 index 000000000000..a8e7ca36d9d4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmspoQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list items that can be backed up. + public partial class BmspoQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmspoQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmspoQueryObjectInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Backup management type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private string _containerName; + + /// Full name of the container whose Protectable Objects should be returned. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Backing field for property. + private string _status; + + /// Backup status query parameter. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? _workloadType; + + /// Workload type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public BmspoQueryObject() + { + + } + } + /// Filters to list items that can be backed up. + public partial interface IBmspoQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup management type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Full name of the container whose Protectable Objects should be returned. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Full name of the container whose Protectable Objects should be returned.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Friendly name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Backup status query parameter. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup status query parameter.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + /// Workload type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload type", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } + /// Filters to list items that can be backed up. + internal partial interface IBmspoQueryObjectInternal + + { + /// Backup management type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Full name of the container whose Protectable Objects should be returned. + string ContainerName { get; set; } + /// Friendly name. + string FriendlyName { get; set; } + /// Backup status query parameter. + string Status { get; set; } + /// Workload type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmspoQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmspoQueryObject.json.cs new file mode 100644 index 000000000000..f811682b2eb6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmspoQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list items that can be backed up. + public partial class BmspoQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BmspoQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmspoQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmspoQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmspoQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BmspoQueryObject(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsrpQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsrpQueryObject.cs new file mode 100644 index 000000000000..85be5d62011a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsrpQueryObject.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list backup copies. + public partial class BmsrpQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsrpQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsrpQueryObjectInternal + { + + /// Backing field for property. + private global::System.DateTime? _endDate; + + /// Backup copies created before this time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? EndDate { get => this._endDate; set => this._endDate = value; } + + /// Backing field for property. + private bool? _extendedInfo; + + /// + /// In Get Recovery Point, it tells whether extended information about recovery point is asked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? ExtendedInfo { get => this._extendedInfo; set => this._extendedInfo = value; } + + /// Backing field for property. + private bool? _moveReadyRpOnly; + + /// Whether the RP can be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? MoveReadyRpOnly { get => this._moveReadyRpOnly; set => this._moveReadyRpOnly = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType? _restorePointQueryType; + + /// RestorePoint type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType? RestorePointQueryType { get => this._restorePointQueryType; set => this._restorePointQueryType = value; } + + /// Backing field for property. + private global::System.DateTime? _startDate; + + /// Backup copies created after this time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? StartDate { get => this._startDate; set => this._startDate = value; } + + /// Creates an new instance. + public BmsrpQueryObject() + { + + } + } + /// Filters to list backup copies. + public partial interface IBmsrpQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup copies created before this time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup copies created before this time.", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndDate { get; set; } + /// + /// In Get Recovery Point, it tells whether extended information about recovery point is asked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"In Get Recovery Point, it tells whether extended information about recovery point is asked.", + SerializedName = @"extendedInfo", + PossibleTypes = new [] { typeof(bool) })] + bool? ExtendedInfo { get; set; } + /// Whether the RP can be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the RP can be moved to another tier", + SerializedName = @"moveReadyRPOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? MoveReadyRpOnly { get; set; } + /// RestorePoint type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"RestorePoint type", + SerializedName = @"restorePointQueryType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType? RestorePointQueryType { get; set; } + /// Backup copies created after this time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup copies created after this time.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartDate { get; set; } + + } + /// Filters to list backup copies. + internal partial interface IBmsrpQueryObjectInternal + + { + /// Backup copies created before this time. + global::System.DateTime? EndDate { get; set; } + /// + /// In Get Recovery Point, it tells whether extended information about recovery point is asked. + /// + bool? ExtendedInfo { get; set; } + /// Whether the RP can be moved to another tier + bool? MoveReadyRpOnly { get; set; } + /// RestorePoint type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType? RestorePointQueryType { get; set; } + /// Backup copies created after this time. + global::System.DateTime? StartDate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsrpQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsrpQueryObject.json.cs new file mode 100644 index 000000000000..b4fcebbbc70c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/BmsrpQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list backup copies. + public partial class BmsrpQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal BmsrpQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_startDate = If( json?.PropertyT("startDate"), out var __jsonStartDate) ? global::System.DateTime.TryParse((string)__jsonStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateValue) ? __jsonStartDateValue : StartDate : StartDate;} + {_endDate = If( json?.PropertyT("endDate"), out var __jsonEndDate) ? global::System.DateTime.TryParse((string)__jsonEndDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateValue) ? __jsonEndDateValue : EndDate : EndDate;} + {_restorePointQueryType = If( json?.PropertyT("restorePointQueryType"), out var __jsonRestorePointQueryType) ? (string)__jsonRestorePointQueryType : (string)RestorePointQueryType;} + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? (bool?)__jsonExtendedInfo : ExtendedInfo;} + {_moveReadyRpOnly = If( json?.PropertyT("moveReadyRPOnly"), out var __jsonMoveReadyRpOnly) ? (bool?)__jsonMoveReadyRpOnly : MoveReadyRpOnly;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsrpQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsrpQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBmsrpQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BmsrpQueryObject(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._startDate ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._startDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startDate" ,container.Add ); + AddIf( null != this._endDate ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._endDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endDate" ,container.Add ); + AddIf( null != (((object)this._restorePointQueryType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._restorePointQueryType.ToString()) : null, "restorePointQueryType" ,container.Add ); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._extendedInfo) : null, "extendedInfo" ,container.Add ); + AddIf( null != this._moveReadyRpOnly ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._moveReadyRpOnly) : null, "moveReadyRPOnly" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryDisplay.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryDisplay.cs new file mode 100644 index 000000000000..33db1ead6349 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryDisplay.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Localized display information of an operation. + public partial class ClientDiscoveryDisplay : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplay, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplayInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the operation having details of what operation is about. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _operation; + + /// Operations Name itself. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private string _provider; + + /// Name of the provider for display purposes + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Backing field for property. + private string _resource; + + /// ResourceType for which this Operation can be performed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Resource { get => this._resource; set => this._resource = value; } + + /// Creates an new instance. + public ClientDiscoveryDisplay() + { + + } + } + /// Localized display information of an operation. + public partial interface IClientDiscoveryDisplay : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Description of the operation having details of what operation is about. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation having details of what operation is about.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Operations Name itself. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operations Name itself.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// Name of the provider for display purposes + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the provider for display purposes", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + /// ResourceType for which this Operation can be performed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ResourceType for which this Operation can be performed.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; set; } + + } + /// Localized display information of an operation. + internal partial interface IClientDiscoveryDisplayInternal + + { + /// Description of the operation having details of what operation is about. + string Description { get; set; } + /// Operations Name itself. + string Operation { get; set; } + /// Name of the provider for display purposes + string Provider { get; set; } + /// ResourceType for which this Operation can be performed. + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryDisplay.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryDisplay.json.cs new file mode 100644 index 000000000000..00d168491fe1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryDisplay.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Localized display information of an operation. + public partial class ClientDiscoveryDisplay + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ClientDiscoveryDisplay(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ClientDiscoveryDisplay(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForLogSpecification.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForLogSpecification.cs new file mode 100644 index 000000000000..cf73cc28e89f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForLogSpecification.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Class to represent shoebox log specification in json client discovery. + public partial class ClientDiscoveryForLogSpecification : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecificationInternal + { + + /// Backing field for property. + private string _blobDuration; + + /// blob duration of shoebox log specification + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BlobDuration { get => this._blobDuration; set => this._blobDuration = value; } + + /// Backing field for property. + private string _displayName; + + /// Localized display name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _name; + + /// Name for shoebox log specification. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public ClientDiscoveryForLogSpecification() + { + + } + } + /// Class to represent shoebox log specification in json client discovery. + public partial interface IClientDiscoveryForLogSpecification : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// blob duration of shoebox log specification + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"blob duration of shoebox log specification", + SerializedName = @"blobDuration", + PossibleTypes = new [] { typeof(string) })] + string BlobDuration { get; set; } + /// Localized display name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Localized display name", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Name for shoebox log specification. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name for shoebox log specification.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Class to represent shoebox log specification in json client discovery. + internal partial interface IClientDiscoveryForLogSpecificationInternal + + { + /// blob duration of shoebox log specification + string BlobDuration { get; set; } + /// Localized display name + string DisplayName { get; set; } + /// Name for shoebox log specification. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForLogSpecification.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForLogSpecification.json.cs new file mode 100644 index 000000000000..159cd02191d2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForLogSpecification.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Class to represent shoebox log specification in json client discovery. + public partial class ClientDiscoveryForLogSpecification + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ClientDiscoveryForLogSpecification(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_blobDuration = If( json?.PropertyT("blobDuration"), out var __jsonBlobDuration) ? (string)__jsonBlobDuration : (string)BlobDuration;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ClientDiscoveryForLogSpecification(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._blobDuration)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._blobDuration.ToString()) : null, "blobDuration" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForProperties.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForProperties.cs new file mode 100644 index 000000000000..128836dd4c00 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForProperties.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Class to represent shoebox properties in json client discovery. + public partial class ClientDiscoveryForProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForProperties, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForPropertiesInternal + { + + /// Internal Acessors for ServiceSpecification + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForPropertiesInternal.ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryForServiceSpecification()); set { {_serviceSpecification = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecification _serviceSpecification; + + /// Operation properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecification ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryForServiceSpecification()); set => this._serviceSpecification = value; } + + /// List of log specifications of this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification[] ServiceSpecificationLogSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecificationInternal)ServiceSpecification).LogSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecificationInternal)ServiceSpecification).LogSpecification = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public ClientDiscoveryForProperties() + { + + } + } + /// Class to represent shoebox properties in json client discovery. + public partial interface IClientDiscoveryForProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of log specifications of this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of log specifications of this operation.", + SerializedName = @"logSpecifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification[] ServiceSpecificationLogSpecification { get; set; } + + } + /// Class to represent shoebox properties in json client discovery. + internal partial interface IClientDiscoveryForPropertiesInternal + + { + /// Operation properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecification ServiceSpecification { get; set; } + /// List of log specifications of this operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification[] ServiceSpecificationLogSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForProperties.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForProperties.json.cs new file mode 100644 index 000000000000..ff75bb025e69 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForProperties.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Class to represent shoebox properties in json client discovery. + public partial class ClientDiscoveryForProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ClientDiscoveryForProperties(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serviceSpecification = If( json?.PropertyT("serviceSpecification"), out var __jsonServiceSpecification) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryForServiceSpecification.FromJson(__jsonServiceSpecification) : ServiceSpecification;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ClientDiscoveryForProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._serviceSpecification ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._serviceSpecification.ToJson(null,serializationMode) : null, "serviceSpecification" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForServiceSpecification.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForServiceSpecification.cs new file mode 100644 index 000000000000..13684beb0cc4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForServiceSpecification.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Class to represent shoebox service specification in json client discovery. + public partial class ClientDiscoveryForServiceSpecification : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecification, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecificationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification[] _logSpecification; + + /// List of log specifications of this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification[] LogSpecification { get => this._logSpecification; set => this._logSpecification = value; } + + /// Creates an new instance. + public ClientDiscoveryForServiceSpecification() + { + + } + } + /// Class to represent shoebox service specification in json client discovery. + public partial interface IClientDiscoveryForServiceSpecification : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of log specifications of this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of log specifications of this operation.", + SerializedName = @"logSpecifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification[] LogSpecification { get; set; } + + } + /// Class to represent shoebox service specification in json client discovery. + internal partial interface IClientDiscoveryForServiceSpecificationInternal + + { + /// List of log specifications of this operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification[] LogSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForServiceSpecification.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForServiceSpecification.json.cs new file mode 100644 index 000000000000..9faeb69d2f99 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryForServiceSpecification.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Class to represent shoebox service specification in json client discovery. + public partial class ClientDiscoveryForServiceSpecification + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ClientDiscoveryForServiceSpecification(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_logSpecification = If( json?.PropertyT("logSpecifications"), out var __jsonLogSpecifications) ? If( __jsonLogSpecifications as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryForLogSpecification.FromJson(__u) )) ))() : null : LogSpecification;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecification. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecification. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ClientDiscoveryForServiceSpecification(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._logSpecification) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._logSpecification ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("logSpecifications",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryResponse.cs new file mode 100644 index 000000000000..2112a21af4c5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryResponse.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operations List response which contains list of available APIs. + public partial class ClientDiscoveryResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryResponseInternal + { + + /// Backing field for property. + private string _nextLink; + + /// Link to the next chunk of Response. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApi[] _value; + + /// List of available operations. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApi[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ClientDiscoveryResponse() + { + + } + } + /// Operations List response which contains list of available APIs. + public partial interface IClientDiscoveryResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Link to the next chunk of Response. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Link to the next chunk of Response.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of available operations. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of available operations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApi) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApi[] Value { get; set; } + + } + /// Operations List response which contains list of available APIs. + internal partial interface IClientDiscoveryResponseInternal + + { + /// Link to the next chunk of Response. + string NextLink { get; set; } + /// List of available operations. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApi[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryResponse.json.cs new file mode 100644 index 000000000000..9cdaddfea5b2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryResponse.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operations List response which contains list of available APIs. + public partial class ClientDiscoveryResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ClientDiscoveryResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApi) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryValueForSingleApi.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ClientDiscoveryResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryValueForSingleApi.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryValueForSingleApi.cs new file mode 100644 index 000000000000..619ed20163cf --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryValueForSingleApi.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Available operation details. + public partial class ClientDiscoveryValueForSingleApi : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApi, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApiInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplay _display; + + /// Contains the localized display information for this particular operation + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryDisplay()); set => this._display = value; } + + /// Description of the operation having details of what operation is about. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplayInternal)Display).Description = value ?? null; } + + /// Operations Name itself. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplayInternal)Display).Operation = value ?? null; } + + /// Name of the provider for display purposes + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplayInternal)Display).Provider = value ?? null; } + + /// ResourceType for which this Operation can be performed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplayInternal)Display).Resource = value ?? null; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplay Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApiInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryDisplay()); set { {_display = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApiInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryForProperties()); set { {_property = value;} } } + + /// Internal Acessors for ServiceSpecification + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApiInternal.ServiceSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForPropertiesInternal)Property).ServiceSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForPropertiesInternal)Property).ServiceSpecification = value; } + + /// Backing field for property. + private string _name; + + /// Name of the Operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _origin; + + /// + /// The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Origin { get => this._origin; set => this._origin = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForProperties _property; + + /// ShoeBox properties for the given operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryForProperties()); set => this._property = value; } + + /// List of log specifications of this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification[] ServiceSpecificationLogSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForPropertiesInternal)Property).ServiceSpecificationLogSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForPropertiesInternal)Property).ServiceSpecificationLogSpecification = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public ClientDiscoveryValueForSingleApi() + { + + } + } + /// Available operation details. + public partial interface IClientDiscoveryValueForSingleApi : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Description of the operation having details of what operation is about. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation having details of what operation is about.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; set; } + /// Operations Name itself. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operations Name itself.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; set; } + /// Name of the provider for display purposes + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the provider for display purposes", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; set; } + /// ResourceType for which this Operation can be performed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ResourceType for which this Operation can be performed.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; set; } + /// Name of the Operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the Operation.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX", + SerializedName = @"origin", + PossibleTypes = new [] { typeof(string) })] + string Origin { get; set; } + /// List of log specifications of this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of log specifications of this operation.", + SerializedName = @"logSpecifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification[] ServiceSpecificationLogSpecification { get; set; } + + } + /// Available operation details. + internal partial interface IClientDiscoveryValueForSingleApiInternal + + { + /// Contains the localized display information for this particular operation + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryDisplay Display { get; set; } + /// Description of the operation having details of what operation is about. + string DisplayDescription { get; set; } + /// Operations Name itself. + string DisplayOperation { get; set; } + /// Name of the provider for display purposes + string DisplayProvider { get; set; } + /// ResourceType for which this Operation can be performed. + string DisplayResource { get; set; } + /// Name of the Operation. + string Name { get; set; } + /// + /// The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX + /// + string Origin { get; set; } + /// ShoeBox properties for the given operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForProperties Property { get; set; } + /// Operation properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForServiceSpecification ServiceSpecification { get; set; } + /// List of log specifications of this operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryForLogSpecification[] ServiceSpecificationLogSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryValueForSingleApi.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryValueForSingleApi.json.cs new file mode 100644 index 000000000000..ba680ee906ce --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientDiscoveryValueForSingleApi.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Available operation details. + public partial class ClientDiscoveryValueForSingleApi + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ClientDiscoveryValueForSingleApi(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryDisplay.FromJson(__jsonDisplay) : Display;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryForProperties.FromJson(__jsonProperties) : Property;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApi. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApi. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientDiscoveryValueForSingleApi FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ClientDiscoveryValueForSingleApi(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientScriptForConnect.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientScriptForConnect.cs new file mode 100644 index 000000000000..61366a765981 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientScriptForConnect.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Client script details for file / folder restore. + public partial class ClientScriptForConnect : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnectInternal + { + + /// Backing field for property. + private string _oSType; + + /// + /// OS type - Windows, Linux etc. for which this file / folder restore client script works. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string OSType { get => this._oSType; set => this._oSType = value; } + + /// Backing field for property. + private string _scriptContent; + + /// File content of the client script for file / folder restore. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ScriptContent { get => this._scriptContent; set => this._scriptContent = value; } + + /// Backing field for property. + private string _scriptExtension; + + /// + /// File extension of the client script for file / folder restore - .ps1 , .sh , etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ScriptExtension { get => this._scriptExtension; set => this._scriptExtension = value; } + + /// Backing field for property. + private string _scriptNameSuffix; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ScriptNameSuffix { get => this._scriptNameSuffix; set => this._scriptNameSuffix = value; } + + /// Backing field for property. + private string _url; + + /// + /// URL of Executable from where to source the content. If this is not null then ScriptContent should not be used + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Url { get => this._url; set => this._url = value; } + + /// Creates an new instance. + public ClientScriptForConnect() + { + + } + } + /// Client script details for file / folder restore. + public partial interface IClientScriptForConnect : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// OS type - Windows, Linux etc. for which this file / folder restore client script works. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OS type - Windows, Linux etc. for which this file / folder restore client script works.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(string) })] + string OSType { get; set; } + /// File content of the client script for file / folder restore. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File content of the client script for file / folder restore.", + SerializedName = @"scriptContent", + PossibleTypes = new [] { typeof(string) })] + string ScriptContent { get; set; } + /// + /// File extension of the client script for file / folder restore - .ps1 , .sh , etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File extension of the client script for file / folder restore - .ps1 , .sh , etc.", + SerializedName = @"scriptExtension", + PossibleTypes = new [] { typeof(string) })] + string ScriptExtension { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scriptNameSuffix", + PossibleTypes = new [] { typeof(string) })] + string ScriptNameSuffix { get; set; } + /// + /// URL of Executable from where to source the content. If this is not null then ScriptContent should not be used + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL of Executable from where to source the content. If this is not null then ScriptContent should not be used", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + + } + /// Client script details for file / folder restore. + internal partial interface IClientScriptForConnectInternal + + { + /// + /// OS type - Windows, Linux etc. for which this file / folder restore client script works. + /// + string OSType { get; set; } + /// File content of the client script for file / folder restore. + string ScriptContent { get; set; } + /// + /// File extension of the client script for file / folder restore - .ps1 , .sh , etc. + /// + string ScriptExtension { get; set; } + /// + /// 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. + /// + string ScriptNameSuffix { get; set; } + /// + /// URL of Executable from where to source the content. If this is not null then ScriptContent should not be used + /// + string Url { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientScriptForConnect.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientScriptForConnect.json.cs new file mode 100644 index 000000000000..4177342f5f39 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ClientScriptForConnect.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Client script details for file / folder restore. + public partial class ClientScriptForConnect + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ClientScriptForConnect(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_scriptContent = If( json?.PropertyT("scriptContent"), out var __jsonScriptContent) ? (string)__jsonScriptContent : (string)ScriptContent;} + {_scriptExtension = If( json?.PropertyT("scriptExtension"), out var __jsonScriptExtension) ? (string)__jsonScriptExtension : (string)ScriptExtension;} + {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)OSType;} + {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)Url;} + {_scriptNameSuffix = If( json?.PropertyT("scriptNameSuffix"), out var __jsonScriptNameSuffix) ? (string)__jsonScriptNameSuffix : (string)ScriptNameSuffix;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ClientScriptForConnect(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._scriptContent)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._scriptContent.ToString()) : null, "scriptContent" ,container.Add ); + AddIf( null != (((object)this._scriptExtension)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._scriptExtension.ToString()) : null, "scriptExtension" ,container.Add ); + AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oSType.ToString()) : null, "osType" ,container.Add ); + AddIf( null != (((object)this._url)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._url.ToString()) : null, "url" ,container.Add ); + AddIf( null != (((object)this._scriptNameSuffix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._scriptNameSuffix.ToString()) : null, "scriptNameSuffix" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudError.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudError.cs new file mode 100644 index 000000000000..25cca0619ca6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudError.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// An error response from the Container Instance service. + public partial class CloudError : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudError, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorInternal + { + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).AdditionalInfo; } + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Code; } + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Detail; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody _error; + + /// The error object. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudErrorBody()); set => this._error = value; } + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).AdditionalInfo = value; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Code = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Detail = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudErrorBody()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Message = value; } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Target = value; } + + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal)Error).Target; } + + /// Creates an new instance. + public CloudError() + { + + } + } + /// An error response from the Container Instance service. + public partial interface ICloudError : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody[] Detail { get; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The target of the particular error. For example, the name of the property in error.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// An error response from the Container Instance service. + internal partial interface ICloudErrorInternal + + { + /// The error additional info. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody[] Detail { get; set; } + /// The error object. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody Error { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudError.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudError.json.cs new file mode 100644 index 000000000000..fdc562d249f2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudError.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// An error response from the Container Instance service. + public partial class CloudError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal CloudError(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudErrorBody.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudError FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new CloudError(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudErrorBody.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudErrorBody.cs new file mode 100644 index 000000000000..c8c8dbeb74e5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudErrorBody.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// An error response from the Container Instance service. + public partial class CloudErrorBody : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] _additionalInfo; + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } + + /// Backing field for property. + private string _code; + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody[] _detail; + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody[] Detail { get => this._detail; } + + /// Backing field for property. + private string _message; + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal.Detail { get => this._detail; set { {_detail = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBodyInternal.Target { get => this._target; set { {_target = value;} } } + + /// Backing field for property. + private string _target; + + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Target { get => this._target; } + + /// Creates an new instance. + public CloudErrorBody() + { + + } + } + /// An error response from the Container Instance service. + public partial interface ICloudErrorBody : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody[] Detail { get; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The target of the particular error. For example, the name of the property in error.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// An error response from the Container Instance service. + internal partial interface ICloudErrorBodyInternal + + { + /// The error additional info. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudErrorBody.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudErrorBody.json.cs new file mode 100644 index 000000000000..c461c0afed76 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/CloudErrorBody.json.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// An error response from the Container Instance service. + public partial class CloudErrorBody + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal CloudErrorBody(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudErrorBody.FromJson(__u) )) ))() : null : Detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : AdditionalInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ICloudErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new CloudErrorBody(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._detail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._detail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("details",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._additionalInfo) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._additionalInfo ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("additionalInfo",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ContainerIdentityInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ContainerIdentityInfo.cs new file mode 100644 index 000000000000..15f42c6c35e4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ContainerIdentityInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container identity information + public partial class ContainerIdentityInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfoInternal + { + + /// Backing field for property. + private string _aadTenantId; + + /// Protection container identity - AAD Tenant + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AadTenantId { get => this._aadTenantId; set => this._aadTenantId = value; } + + /// Backing field for property. + private string _audience; + + /// Protection container identity - Audience + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Audience { get => this._audience; set => this._audience = value; } + + /// Backing field for property. + private string _servicePrincipalClientId; + + /// Protection container identity - AAD Service Principal + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ServicePrincipalClientId { get => this._servicePrincipalClientId; set => this._servicePrincipalClientId = value; } + + /// Backing field for property. + private string _uniqueName; + + /// Unique name of the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string UniqueName { get => this._uniqueName; set => this._uniqueName = value; } + + /// Creates an new instance. + public ContainerIdentityInfo() + { + + } + } + /// Container identity information + public partial interface IContainerIdentityInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Protection container identity - AAD Tenant + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection container identity - AAD Tenant", + SerializedName = @"aadTenantId", + PossibleTypes = new [] { typeof(string) })] + string AadTenantId { get; set; } + /// Protection container identity - Audience + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection container identity - Audience", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + string Audience { get; set; } + /// Protection container identity - AAD Service Principal + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection container identity - AAD Service Principal", + SerializedName = @"servicePrincipalClientId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalClientId { get; set; } + /// Unique name of the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique name of the container", + SerializedName = @"uniqueName", + PossibleTypes = new [] { typeof(string) })] + string UniqueName { get; set; } + + } + /// Container identity information + internal partial interface IContainerIdentityInfoInternal + + { + /// Protection container identity - AAD Tenant + string AadTenantId { get; set; } + /// Protection container identity - Audience + string Audience { get; set; } + /// Protection container identity - AAD Service Principal + string ServicePrincipalClientId { get; set; } + /// Unique name of the container + string UniqueName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ContainerIdentityInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ContainerIdentityInfo.json.cs new file mode 100644 index 000000000000..0f98eb23a10d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ContainerIdentityInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container identity information + public partial class ContainerIdentityInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerIdentityInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_uniqueName = If( json?.PropertyT("uniqueName"), out var __jsonUniqueName) ? (string)__jsonUniqueName : (string)UniqueName;} + {_aadTenantId = If( json?.PropertyT("aadTenantId"), out var __jsonAadTenantId) ? (string)__jsonAadTenantId : (string)AadTenantId;} + {_servicePrincipalClientId = If( json?.PropertyT("servicePrincipalClientId"), out var __jsonServicePrincipalClientId) ? (string)__jsonServicePrincipalClientId : (string)ServicePrincipalClientId;} + {_audience = If( json?.PropertyT("audience"), out var __jsonAudience) ? (string)__jsonAudience : (string)Audience;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ContainerIdentityInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._uniqueName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._uniqueName.ToString()) : null, "uniqueName" ,container.Add ); + AddIf( null != (((object)this._aadTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._aadTenantId.ToString()) : null, "aadTenantId" ,container.Add ); + AddIf( null != (((object)this._servicePrincipalClientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._servicePrincipalClientId.ToString()) : null, "servicePrincipalClientId" ,container.Add ); + AddIf( null != (((object)this._audience)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._audience.ToString()) : null, "audience" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionFormat.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionFormat.cs new file mode 100644 index 000000000000..161f1a47e370 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionFormat.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Daily retention format. + public partial class DailyRetentionFormat : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormatInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] _daysOfTheMonth; + + /// List of days of the month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] DaysOfTheMonth { get => this._daysOfTheMonth; set => this._daysOfTheMonth = value; } + + /// Creates an new instance. + public DailyRetentionFormat() + { + + } + } + /// Daily retention format. + public partial interface IDailyRetentionFormat : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of days of the month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of the month.", + SerializedName = @"daysOfTheMonth", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] DaysOfTheMonth { get; set; } + + } + /// Daily retention format. + internal partial interface IDailyRetentionFormatInternal + + { + /// List of days of the month. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] DaysOfTheMonth { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionFormat.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionFormat.json.cs new file mode 100644 index 000000000000..20ef32873c57 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionFormat.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Daily retention format. + public partial class DailyRetentionFormat + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DailyRetentionFormat(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_daysOfTheMonth = If( json?.PropertyT("daysOfTheMonth"), out var __jsonDaysOfTheMonth) ? If( __jsonDaysOfTheMonth as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Day.FromJson(__u) )) ))() : null : DaysOfTheMonth;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DailyRetentionFormat(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._daysOfTheMonth) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._daysOfTheMonth ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("daysOfTheMonth",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionSchedule.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionSchedule.cs new file mode 100644 index 000000000000..62c82d44f0eb --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionSchedule.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Daily retention schedule. + public partial class DailyRetentionSchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionSchedule, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionScheduleInternal + { + + /// Internal Acessors for RetentionDuration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionScheduleInternal.RetentionDuration { get => (this._retentionDuration = this._retentionDuration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration()); set { {_retentionDuration = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration _retentionDuration; + + /// Retention duration of retention Policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration RetentionDuration { get => (this._retentionDuration = this._retentionDuration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration()); set => this._retentionDuration = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? RetentionDurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).Count = value ?? default(int); } + + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).DurationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).DurationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType)""); } + + /// Backing field for property. + private global::System.DateTime[] _retentionTime; + + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime[] RetentionTime { get => this._retentionTime; set => this._retentionTime = value; } + + /// Creates an new instance. + public DailyRetentionSchedule() + { + + } + } + /// Daily retention schedule. + public partial interface IDailyRetentionSchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? RetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type of retention policy.", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get; set; } + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention times of retention policy.", + SerializedName = @"retentionTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] RetentionTime { get; set; } + + } + /// Daily retention schedule. + internal partial interface IDailyRetentionScheduleInternal + + { + /// Retention duration of retention Policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration RetentionDuration { get; set; } + /// + /// 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. + /// + int? RetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get; set; } + /// Retention times of retention policy. + global::System.DateTime[] RetentionTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionSchedule.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionSchedule.json.cs new file mode 100644 index 000000000000..6833f03e2b84 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailyRetentionSchedule.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Daily retention schedule. + public partial class DailyRetentionSchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DailyRetentionSchedule(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_retentionDuration = If( json?.PropertyT("retentionDuration"), out var __jsonRetentionDuration) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration.FromJson(__jsonRetentionDuration) : RetentionDuration;} + {_retentionTime = If( json?.PropertyT("retentionTimes"), out var __jsonRetentionTimes) ? If( __jsonRetentionTimes as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(global::System.DateTime) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? global::System.DateTime.TryParse((string)__t, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __tValue) ? __tValue : default(global::System.DateTime) : default(global::System.DateTime))) ))() : null : RetentionTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionSchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionSchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DailyRetentionSchedule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._retentionDuration ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionDuration.ToJson(null,serializationMode) : null, "retentionDuration" ,container.Add ); + if (null != this._retentionTime) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._retentionTime ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) ,__w.Add); + } + container.Add("retentionTimes",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailySchedule.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailySchedule.cs new file mode 100644 index 000000000000..e47c58daf9a0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailySchedule.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class DailySchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailySchedule, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyScheduleInternal + { + + /// Backing field for property. + private global::System.DateTime[] _scheduleRunTime; + + /// List of times of day this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime[] ScheduleRunTime { get => this._scheduleRunTime; set => this._scheduleRunTime = value; } + + /// Creates an new instance. + public DailySchedule() + { + + } + } + public partial interface IDailySchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of times of day this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of times of day this schedule has to be run.", + SerializedName = @"scheduleRunTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] ScheduleRunTime { get; set; } + + } + internal partial interface IDailyScheduleInternal + + { + /// List of times of day this schedule has to be run. + global::System.DateTime[] ScheduleRunTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailySchedule.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailySchedule.json.cs new file mode 100644 index 000000000000..1b07e3fe941e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DailySchedule.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class DailySchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DailySchedule(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_scheduleRunTime = If( json?.PropertyT("scheduleRunTimes"), out var __jsonScheduleRunTimes) ? If( __jsonScheduleRunTimes as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(global::System.DateTime) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? global::System.DateTime.TryParse((string)__t, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __tValue) ? __tValue : default(global::System.DateTime) : default(global::System.DateTime))) ))() : null : ScheduleRunTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailySchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailySchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DailySchedule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._scheduleRunTime) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._scheduleRunTime ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) ,__w.Add); + } + container.Add("scheduleRunTimes",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Day.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Day.cs new file mode 100644 index 000000000000..bba3aa693853 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Day.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Day of the week. + public partial class Day : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDayInternal + { + + /// Backing field for property. + private int? _date; + + /// Date of the month + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? Date { get => this._date; set => this._date = value; } + + /// Backing field for property. + private bool? _isLast; + + /// Whether Date is last date of month + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsLast { get => this._isLast; set => this._isLast = value; } + + /// Creates an new instance. + public Day() + { + + } + } + /// Day of the week. + public partial interface IDay : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Date of the month + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date of the month", + SerializedName = @"date", + PossibleTypes = new [] { typeof(int) })] + int? Date { get; set; } + /// Whether Date is last date of month + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether Date is last date of month", + SerializedName = @"isLast", + PossibleTypes = new [] { typeof(bool) })] + bool? IsLast { get; set; } + + } + /// Day of the week. + internal partial interface IDayInternal + + { + /// Date of the month + int? Date { get; set; } + /// Whether Date is last date of month + bool? IsLast { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Day.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Day.json.cs new file mode 100644 index 000000000000..b28a99857252 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Day.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Day of the week. + public partial class Day + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal Day(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_date = If( json?.PropertyT("date"), out var __jsonDate) ? (int?)__jsonDate : Date;} + {_isLast = If( json?.PropertyT("isLast"), out var __jsonIsLast) ? (bool?)__jsonIsLast : IsLast;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new Day(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._date ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._date) : null, "date" ,container.Add ); + AddIf( null != this._isLast ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isLast) : null, "isLast" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskExclusionProperties.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskExclusionProperties.cs new file mode 100644 index 000000000000..6132f25f9e5c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskExclusionProperties.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class DiskExclusionProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionPropertiesInternal + { + + /// Backing field for property. + private int[] _diskLunList; + + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int[] DiskLunList { get => this._diskLunList; set => this._diskLunList = value; } + + /// Backing field for property. + private bool? _isInclusionList; + + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsInclusionList { get => this._isInclusionList; set => this._isInclusionList = value; } + + /// Creates an new instance. + public DiskExclusionProperties() + { + + } + } + public partial interface IDiskExclusionProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection.", + SerializedName = @"diskLunList", + PossibleTypes = new [] { typeof(int) })] + int[] DiskLunList { get; set; } + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to indicate whether DiskLunList is to be included/ excluded from backup.", + SerializedName = @"isInclusionList", + PossibleTypes = new [] { typeof(bool) })] + bool? IsInclusionList { get; set; } + + } + internal partial interface IDiskExclusionPropertiesInternal + + { + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + int[] DiskLunList { get; set; } + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + bool? IsInclusionList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskExclusionProperties.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskExclusionProperties.json.cs new file mode 100644 index 000000000000..4373067487d8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskExclusionProperties.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class DiskExclusionProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DiskExclusionProperties(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_diskLunList = If( json?.PropertyT("diskLunList"), out var __jsonDiskLunList) ? If( __jsonDiskLunList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(int) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber __t ? (int)__t : default(int))) ))() : null : DiskLunList;} + {_isInclusionList = If( json?.PropertyT("isInclusionList"), out var __jsonIsInclusionList) ? (bool?)__jsonIsInclusionList : IsInclusionList;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DiskExclusionProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._diskLunList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._diskLunList ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber(__x) ,__w.Add); + } + container.Add("diskLunList",__w); + } + AddIf( null != this._isInclusionList ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isInclusionList) : null, "isInclusionList" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskInformation.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskInformation.cs new file mode 100644 index 000000000000..da2397bd2429 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskInformation.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Disk information + public partial class DiskInformation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformationInternal + { + + /// Backing field for property. + private int? _lun; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? Lun { get => this._lun; set => this._lun = value; } + + /// Backing field for property. + private string _name; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public DiskInformation() + { + + } + } + /// Disk information + public partial interface IDiskInformation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lun", + PossibleTypes = new [] { typeof(int) })] + int? Lun { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Disk information + internal partial interface IDiskInformationInternal + + { + int? Lun { get; set; } + + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskInformation.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskInformation.json.cs new file mode 100644 index 000000000000..45e507ce813b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DiskInformation.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Disk information + public partial class DiskInformation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DiskInformation(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_lun = If( json?.PropertyT("lun"), out var __jsonLun) ? (int?)__jsonLun : Lun;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DiskInformation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._lun ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._lun) : null, "lun" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DistributedNodesInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DistributedNodesInfo.cs new file mode 100644 index 000000000000..d327302f72c5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DistributedNodesInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// This is used to represent the various nodes of the distributed container. + public partial class DistributedNodesInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail _errorDetail; + + /// Error Details if the Status is non-success. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail ErrorDetail { get => (this._errorDetail = this._errorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail()); set => this._errorDetail = value; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Code; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Message; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Recommendation; } + + /// Internal Acessors for ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfoInternal.ErrorDetail { get => (this._errorDetail = this._errorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail()); set { {_errorDetail = value;} } } + + /// Internal Acessors for ErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfoInternal.ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Code = value; } + + /// Internal Acessors for ErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfoInternal.ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Message = value; } + + /// Internal Acessors for ErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfoInternal.ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Recommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Recommendation = value; } + + /// Backing field for property. + private string _nodeName; + + /// Name of the node under a distributed container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string NodeName { get => this._nodeName; set => this._nodeName = value; } + + /// Backing field for property. + private string _status; + + /// + /// Status of this Node. + /// Failed | Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public DistributedNodesInfo() + { + + } + } + /// This is used to represent the various nodes of the distributed container. + public partial interface IDistributedNodesInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailCode { get; } + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message related to the Code.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailMessage { get; } + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of recommendation strings.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] ErrorDetailRecommendation { get; } + /// Name of the node under a distributed container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the node under a distributed container.", + SerializedName = @"nodeName", + PossibleTypes = new [] { typeof(string) })] + string NodeName { get; set; } + /// + /// Status of this Node. + /// Failed | Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of this Node. + Failed | Succeeded", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + + } + /// This is used to represent the various nodes of the distributed container. + internal partial interface IDistributedNodesInfoInternal + + { + /// Error Details if the Status is non-success. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail ErrorDetail { get; set; } + /// Error code. + string ErrorDetailCode { get; set; } + /// Error Message related to the Code. + string ErrorDetailMessage { get; set; } + /// List of recommendation strings. + string[] ErrorDetailRecommendation { get; set; } + /// Name of the node under a distributed container. + string NodeName { get; set; } + /// + /// Status of this Node. + /// Failed | Succeeded + /// + string Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DistributedNodesInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DistributedNodesInfo.json.cs new file mode 100644 index 000000000000..868d12075027 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DistributedNodesInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// This is used to represent the various nodes of the distributed container. + public partial class DistributedNodesInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DistributedNodesInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorDetail = If( json?.PropertyT("errorDetail"), out var __jsonErrorDetail) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail.FromJson(__jsonErrorDetail) : ErrorDetail;} + {_nodeName = If( json?.PropertyT("nodeName"), out var __jsonNodeName) ? (string)__jsonNodeName : (string)NodeName;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDistributedNodesInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DistributedNodesInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._errorDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._errorDetail.ToJson(null,serializationMode) : null, "errorDetail" ,container.Add ); + AddIf( null != (((object)this._nodeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._nodeName.ToString()) : null, "nodeName" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmBackupEngine.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmBackupEngine.cs new file mode 100644 index 000000000000..5e5472c54eea --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmBackupEngine.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Data Protection Manager (DPM) specific backup engine. + public partial class DpmBackupEngine : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmBackupEngine, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmBackupEngineInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase __backupEngineBase = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineBase(); + + /// Backup agent version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string AzureBackupAgentVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).AzureBackupAgentVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).AzureBackupAgentVersion = value ?? null; } + + /// ID of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupEngineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineId = value ?? null; } + + /// + /// Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupEngineState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineState = value ?? null; } + + /// Type of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType BackupEngineType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupEngineType = value ; } + + /// Type of backup management for the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Flag indicating if the backup engine be registered, once already registered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? CanReRegister { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).CanReRegister; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).CanReRegister = value ?? default(bool); } + + /// Backup engine version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DpmVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).DpmVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).DpmVersion = value ?? null; } + + /// Extended info of the backupengine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfo = value ?? null /* model class */; } + + /// Disk space currently available in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public double? ExtendedInfoAvailableDiskSpace { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoAvailableDiskSpace; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoAvailableDiskSpace = value ?? default(double); } + + /// Protected instances in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoAzureProtectedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoAzureProtectedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoAzureProtectedInstance = value ?? default(int); } + + /// Database name of backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ExtendedInfoDatabaseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoDatabaseName = value ?? null; } + + /// Number of disks in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoDiskCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoDiskCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoDiskCount = value ?? default(int); } + + /// Number of protected items in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoProtectedItemsCount = value ?? default(int); } + + /// Number of protected servers in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ExtendedInfoProtectedServersCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoProtectedServersCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoProtectedServersCount = value ?? default(int); } + + /// Last refresh time in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? ExtendedInfoRefreshedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoRefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoRefreshedAt = value ?? default(global::System.DateTime); } + + /// Disk space used in the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public double? ExtendedInfoUsedDiskSpace { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoUsedDiskSpace; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).ExtendedInfoUsedDiskSpace = value ?? default(double); } + + /// Friendly name of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).FriendlyName = value ?? null; } + + /// Backup status of the backup engine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).HealthStatus = value ?? null; } + + /// To check if backup agent upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsAzureBackupAgentUpgradeAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).IsAzureBackupAgentUpgradeAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).IsAzureBackupAgentUpgradeAvailable = value ?? default(bool); } + + /// To check if backup engine upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDpmUpgradeAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).IsDpmUpgradeAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).IsDpmUpgradeAvailable = value ?? default(bool); } + + /// Registration status of the backup engine with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal)__backupEngineBase).RegistrationStatus = value ?? null; } + + /// Creates an new instance. + public DpmBackupEngine() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__backupEngineBase), __backupEngineBase); + await eventListener.AssertObjectIsValid(nameof(__backupEngineBase), __backupEngineBase); + } + } + /// Data Protection Manager (DPM) specific backup engine. + public partial interface IDpmBackupEngine : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBase + { + + } + /// Data Protection Manager (DPM) specific backup engine. + internal partial interface IDpmBackupEngineInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupEngineBaseInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmBackupEngine.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmBackupEngine.json.cs new file mode 100644 index 000000000000..b43dee95b7ef --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmBackupEngine.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Data Protection Manager (DPM) specific backup engine. + public partial class DpmBackupEngine + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DpmBackupEngine(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __backupEngineBase = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineBase(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmBackupEngine. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmBackupEngine. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmBackupEngine FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DpmBackupEngine(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __backupEngineBase?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainer.cs new file mode 100644 index 000000000000..f03e70ff6548 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainer.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// DPM workload-specific protection container. + public partial class DpmContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Backing field for property. + private bool? _canReRegister; + + /// Specifies whether the container is re-registrable. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? CanReRegister { get => this._canReRegister; set => this._canReRegister = value; } + + /// Backing field for property. + private string _containerId; + + /// ID of container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerId { get => this._containerId; set => this._containerId = value; } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType = value ; } + + /// Backing field for property. + private string _dpmAgentVersion; + + /// Backup engine Agent version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DpmAgentVersion { get => this._dpmAgentVersion; set => this._dpmAgentVersion = value; } + + /// Backing field for property. + private string[] _dpmServer; + + /// List of BackupEngines protecting the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] DpmServer { get => this._dpmServer; set => this._dpmServer = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfo _extendedInfo; + + /// Extended Info of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmContainerExtendedInfo()); set => this._extendedInfo = value; } + + /// Last refresh time of the DPMContainer. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoLastRefreshedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfoInternal)ExtendedInfo).LastRefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfoInternal)ExtendedInfo).LastRefreshedAt = value ?? default(global::System.DateTime); } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus = value ?? null; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmContainerExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType = value ?? null; } + + /// Backing field for property. + private long? _protectedItemCount; + + /// Number of protected items in the BackupEngine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? ProtectedItemCount { get => this._protectedItemCount; set => this._protectedItemCount = value; } + + /// Backing field for property. + private string _protectionStatus; + + /// Protection status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectionStatus { get => this._protectionStatus; set => this._protectionStatus = value; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus = value ?? null; } + + /// Backing field for property. + private bool? _upgradeAvailable; + + /// To check if upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? UpgradeAvailable { get => this._upgradeAvailable; set => this._upgradeAvailable = value; } + + /// Creates an new instance. + public DpmContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionContainer), __protectionContainer); + await eventListener.AssertObjectIsValid(nameof(__protectionContainer), __protectionContainer); + } + } + /// DPM workload-specific protection container. + public partial interface IDpmContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer + { + /// Specifies whether the container is re-registrable. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether the container is re-registrable.", + SerializedName = @"canReRegister", + PossibleTypes = new [] { typeof(bool) })] + bool? CanReRegister { get; set; } + /// ID of container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of container.", + SerializedName = @"containerId", + PossibleTypes = new [] { typeof(string) })] + string ContainerId { get; set; } + /// Backup engine Agent version + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup engine Agent version", + SerializedName = @"dpmAgentVersion", + PossibleTypes = new [] { typeof(string) })] + string DpmAgentVersion { get; set; } + /// List of BackupEngines protecting the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of BackupEngines protecting the container", + SerializedName = @"dpmServers", + PossibleTypes = new [] { typeof(string) })] + string[] DpmServer { get; set; } + /// Last refresh time of the DPMContainer. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last refresh time of the DPMContainer.", + SerializedName = @"lastRefreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoLastRefreshedAt { get; set; } + /// Number of protected items in the BackupEngine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of protected items in the BackupEngine", + SerializedName = @"protectedItemCount", + PossibleTypes = new [] { typeof(long) })] + long? ProtectedItemCount { get; set; } + /// Protection status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection status of the container.", + SerializedName = @"protectionStatus", + PossibleTypes = new [] { typeof(string) })] + string ProtectionStatus { get; set; } + /// To check if upgrade available + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if upgrade available", + SerializedName = @"upgradeAvailable", + PossibleTypes = new [] { typeof(bool) })] + bool? UpgradeAvailable { get; set; } + + } + /// DPM workload-specific protection container. + internal partial interface IDpmContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal + { + /// Specifies whether the container is re-registrable. + bool? CanReRegister { get; set; } + /// ID of container. + string ContainerId { get; set; } + /// Backup engine Agent version + string DpmAgentVersion { get; set; } + /// List of BackupEngines protecting the container + string[] DpmServer { get; set; } + /// Extended Info of the container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfo ExtendedInfo { get; set; } + /// Last refresh time of the DPMContainer. + global::System.DateTime? ExtendedInfoLastRefreshedAt { get; set; } + /// Number of protected items in the BackupEngine + long? ProtectedItemCount { get; set; } + /// Protection status of the container. + string ProtectionStatus { get; set; } + /// To check if upgrade available + bool? UpgradeAvailable { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainer.json.cs new file mode 100644 index 000000000000..68b89f427df3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainer.json.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// DPM workload-specific protection container. + public partial class DpmContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DpmContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmContainerExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_canReRegister = If( json?.PropertyT("canReRegister"), out var __jsonCanReRegister) ? (bool?)__jsonCanReRegister : CanReRegister;} + {_containerId = If( json?.PropertyT("containerId"), out var __jsonContainerId) ? (string)__jsonContainerId : (string)ContainerId;} + {_protectedItemCount = If( json?.PropertyT("protectedItemCount"), out var __jsonProtectedItemCount) ? (long?)__jsonProtectedItemCount : ProtectedItemCount;} + {_dpmAgentVersion = If( json?.PropertyT("dpmAgentVersion"), out var __jsonDpmAgentVersion) ? (string)__jsonDpmAgentVersion : (string)DpmAgentVersion;} + {_dpmServer = If( json?.PropertyT("dpmServers"), out var __jsonDpmServers) ? If( __jsonDpmServers as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : DpmServer;} + {_upgradeAvailable = If( json?.PropertyT("upgradeAvailable"), out var __jsonUpgradeAvailable) ? (bool?)__jsonUpgradeAvailable : UpgradeAvailable;} + {_protectionStatus = If( json?.PropertyT("protectionStatus"), out var __jsonProtectionStatus) ? (string)__jsonProtectionStatus : (string)ProtectionStatus;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainer. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainer interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("containerType") ) + { + case "AzureBackupServerContainer": + { + return new AzureBackupServerContainer(json); + } + } + return new DpmContainer(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionContainer?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != this._canReRegister ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._canReRegister) : null, "canReRegister" ,container.Add ); + AddIf( null != (((object)this._containerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerId.ToString()) : null, "containerId" ,container.Add ); + AddIf( null != this._protectedItemCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._protectedItemCount) : null, "protectedItemCount" ,container.Add ); + AddIf( null != (((object)this._dpmAgentVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dpmAgentVersion.ToString()) : null, "dpmAgentVersion" ,container.Add ); + if (null != this._dpmServer) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._dpmServer ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("dpmServers",__w); + } + AddIf( null != this._upgradeAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._upgradeAvailable) : null, "upgradeAvailable" ,container.Add ); + AddIf( null != (((object)this._protectionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionStatus.ToString()) : null, "protectionStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainerExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainerExtendedInfo.cs new file mode 100644 index 000000000000..fc15b3c2ffda --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainerExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information of the DPMContainer. + public partial class DpmContainerExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfoInternal + { + + /// Backing field for property. + private global::System.DateTime? _lastRefreshedAt; + + /// Last refresh time of the DPMContainer. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? LastRefreshedAt { get => this._lastRefreshedAt; set => this._lastRefreshedAt = value; } + + /// Creates an new instance. + public DpmContainerExtendedInfo() + { + + } + } + /// Additional information of the DPMContainer. + public partial interface IDpmContainerExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Last refresh time of the DPMContainer. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last refresh time of the DPMContainer.", + SerializedName = @"lastRefreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRefreshedAt { get; set; } + + } + /// Additional information of the DPMContainer. + internal partial interface IDpmContainerExtendedInfoInternal + + { + /// Last refresh time of the DPMContainer. + global::System.DateTime? LastRefreshedAt { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainerExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainerExtendedInfo.json.cs new file mode 100644 index 000000000000..38e329a3044d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmContainerExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information of the DPMContainer. + public partial class DpmContainerExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DpmContainerExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_lastRefreshedAt = If( json?.PropertyT("lastRefreshedAt"), out var __jsonLastRefreshedAt) ? global::System.DateTime.TryParse((string)__jsonLastRefreshedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastRefreshedAtValue) ? __jsonLastRefreshedAtValue : LastRefreshedAt : LastRefreshedAt;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmContainerExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DpmContainerExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._lastRefreshedAt ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastRefreshedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastRefreshedAt" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmErrorInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmErrorInfo.cs new file mode 100644 index 000000000000..f85d6b8f7678 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmErrorInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// DPM workload-specific error information. + public partial class DpmErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfoInternal + { + + /// Backing field for property. + private string _errorString; + + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorString { get => this._errorString; set => this._errorString = value; } + + /// Backing field for property. + private string[] _recommendation; + + /// List of localized recommendations for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; set => this._recommendation = value; } + + /// Creates an new instance. + public DpmErrorInfo() + { + + } + } + /// DPM workload-specific error information. + public partial interface IDpmErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Localized error string.", + SerializedName = @"errorString", + PossibleTypes = new [] { typeof(string) })] + string ErrorString { get; set; } + /// List of localized recommendations for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of localized recommendations for above error code.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; set; } + + } + /// DPM workload-specific error information. + internal partial interface IDpmErrorInfoInternal + + { + /// Localized error string. + string ErrorString { get; set; } + /// List of localized recommendations for above error code. + string[] Recommendation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmErrorInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmErrorInfo.json.cs new file mode 100644 index 000000000000..63b5a2b5b08f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmErrorInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// DPM workload-specific error information. + public partial class DpmErrorInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DpmErrorInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorString = If( json?.PropertyT("errorString"), out var __jsonErrorString) ? (string)__jsonErrorString : (string)ErrorString;} + {_recommendation = If( json?.PropertyT("recommendations"), out var __jsonRecommendations) ? If( __jsonRecommendations as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Recommendation;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DpmErrorInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._errorString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorString.ToString()) : null, "errorString" ,container.Add ); + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJob.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJob.cs new file mode 100644 index 000000000000..f28510c61c07 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJob.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// DPM workload-specific job object. + public partial class DpmJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] _actionsInfo; + + /// The state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get => this._actionsInfo; set => this._actionsInfo = value; } + + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ActivityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId = value ?? null; } + + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Backing field for property. + private string _containerName; + + /// Name of cluster/server protecting current backup item, if any. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private string _containerType; + + /// Type of container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerType { get => this._containerType; set => this._containerType = value; } + + /// Backing field for property. + private string _dpmServerName; + + /// DPM server name managing the backup item or backup job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DpmServerName { get => this._dpmServerName; set => this._dpmServerName = value; } + + /// Backing field for property. + private global::System.TimeSpan? _duration; + + /// Time elapsed for job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.TimeSpan? Duration { get => this._duration; set => this._duration = value; } + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? EndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime = value ?? default(global::System.DateTime); } + + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EntityFriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfo[] _errorDetail; + + /// The errors. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfo _extendedInfo; + + /// Additional information for this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmJobExtendedInfo()); set => this._extendedInfo = value; } + + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoDynamicErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage = value ?? null; } + + /// The job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoInternal)ExtendedInfo).PropertyBag = value ?? null /* model class */; } + + /// List of tasks associated with this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoInternal)ExtendedInfo).TasksList = value ?? null /* arrayOf */; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmJobExtendedInfo()); set { {_extendedInfo = value;} } } + + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Operation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation = value ?? null; } + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime = value ?? default(global::System.DateTime); } + + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status = value ?? null; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type = value ; } + + /// Backing field for property. + private string _workloadType; + + /// Type of backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public DpmJob() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__job), __job); + await eventListener.AssertObjectIsValid(nameof(__job), __job); + } + } + /// DPM workload-specific job object. + public partial interface IDpmJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob + { + /// The state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The state/actions applicable on this job like cancel/retry.", + SerializedName = @"actionsInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Name of cluster/server protecting current backup item, if any. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of cluster/server protecting current backup item, if any.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Type of container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of container.", + SerializedName = @"containerType", + PossibleTypes = new [] { typeof(string) })] + string ContainerType { get; set; } + /// DPM server name managing the backup item or backup job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DPM server name managing the backup item or backup job.", + SerializedName = @"dpmServerName", + PossibleTypes = new [] { typeof(string) })] + string DpmServerName { get; set; } + /// Time elapsed for job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time elapsed for job.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Duration { get; set; } + /// The errors. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The errors.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfo[] ErrorDetail { get; set; } + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message on job execution.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoDynamicErrorMessage { get; set; } + /// The job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks associated with this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks associated with this job.", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Type of backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup item.", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(string) })] + string WorkloadType { get; set; } + + } + /// DPM workload-specific job object. + internal partial interface IDpmJobInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal + { + /// The state/actions applicable on this job like cancel/retry. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Name of cluster/server protecting current backup item, if any. + string ContainerName { get; set; } + /// Type of container. + string ContainerType { get; set; } + /// DPM server name managing the backup item or backup job. + string DpmServerName { get; set; } + /// Time elapsed for job. + global::System.TimeSpan? Duration { get; set; } + /// The errors. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfo[] ErrorDetail { get; set; } + /// Additional information for this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfo ExtendedInfo { get; set; } + /// Non localized error message on job execution. + string ExtendedInfoDynamicErrorMessage { get; set; } + /// The job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks associated with this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Type of backup item. + string WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJob.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJob.json.cs new file mode 100644 index 000000000000..7ee5fbfa0286 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJob.json.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// DPM workload-specific job object. + public partial class DpmJob + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DpmJob(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmJobExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonDuration ) : Duration;} + {_dpmServerName = If( json?.PropertyT("dpmServerName"), out var __jsonDpmServerName) ? (string)__jsonDpmServerName : (string)DpmServerName;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_containerType = If( json?.PropertyT("containerType"), out var __jsonContainerType) ? (string)__jsonContainerType : (string)ContainerType;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + {_actionsInfo = If( json?.PropertyT("actionsInfo"), out var __jsonActionsInfo) ? If( __jsonActionsInfo as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)""))) ))() : null : ActionsInfo;} + {_errorDetail = If( json?.PropertyT("errorDetails"), out var __jsonErrorDetails) ? If( __jsonErrorDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmErrorInfo.FromJson(__p) )) ))() : null : ErrorDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJob FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DpmJob(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __job?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)(null != this._duration ? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._duration)): null), "duration" ,container.Add ); + AddIf( null != (((object)this._dpmServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dpmServerName.ToString()) : null, "dpmServerName" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._containerType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerType.ToString()) : null, "containerType" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + if (null != this._actionsInfo) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._actionsInfo ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("actionsInfo",__w); + } + if (null != this._errorDetail) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._errorDetail ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("errorDetails",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfo.cs new file mode 100644 index 000000000000..f994ed3685a9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on the DPM workload-specific job. + public partial class DpmJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoInternal + { + + /// Backing field for property. + private string _dynamicErrorMessage; + + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DynamicErrorMessage { get => this._dynamicErrorMessage; set => this._dynamicErrorMessage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag _propertyBag; + + /// The job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails[] _tasksList; + + /// List of tasks associated with this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails[] TasksList { get => this._tasksList; set => this._tasksList = value; } + + /// Creates an new instance. + public DpmJobExtendedInfo() + { + + } + } + /// Additional information on the DPM workload-specific job. + public partial interface IDpmJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Non localized error message on job execution. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message on job execution.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string DynamicErrorMessage { get; set; } + /// The job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks associated with this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks associated with this job.", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails[] TasksList { get; set; } + + } + /// Additional information on the DPM workload-specific job. + internal partial interface IDpmJobExtendedInfoInternal + + { + /// Non localized error message on job execution. + string DynamicErrorMessage { get; set; } + /// The job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks associated with this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails[] TasksList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfo.json.cs new file mode 100644 index 000000000000..505f9de46b4d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on the DPM workload-specific job. + public partial class DpmJobExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DpmJobExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tasksList = If( json?.PropertyT("tasksList"), out var __jsonTasksList) ? If( __jsonTasksList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmJobTaskDetails.FromJson(__u) )) ))() : null : TasksList;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmJobExtendedInfoPropertyBag.FromJson(__jsonPropertyBag) : PropertyBag;} + {_dynamicErrorMessage = If( json?.PropertyT("dynamicErrorMessage"), out var __jsonDynamicErrorMessage) ? (string)__jsonDynamicErrorMessage : (string)DynamicErrorMessage;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DpmJobExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._tasksList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._tasksList ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("tasksList",__w); + } + AddIf( null != this._propertyBag ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._propertyBag.ToJson(null,serializationMode) : null, "propertyBag" ,container.Add ); + AddIf( null != (((object)this._dynamicErrorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dynamicErrorMessage.ToString()) : null, "dynamicErrorMessage" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..8346d0b9e4e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The job properties. + public partial class DpmJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBagInternal + { + + /// Creates an new instance. + public DpmJobExtendedInfoPropertyBag() + { + + } + } + /// The job properties. + public partial interface IDpmJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// The job properties. + internal partial interface IDpmJobExtendedInfoPropertyBagInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..0ecde474c1e7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class DpmJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..c9cb074a370e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobExtendedInfoPropertyBag.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The job properties. + public partial class DpmJobExtendedInfoPropertyBag + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal DpmJobExtendedInfoPropertyBag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobExtendedInfoPropertyBag FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DpmJobExtendedInfoPropertyBag(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobTaskDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobTaskDetails.cs new file mode 100644 index 000000000000..c895d6f1747c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobTaskDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// DPM workload-specific job task details. + public partial class DpmJobTaskDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetailsInternal + { + + /// Backing field for property. + private global::System.TimeSpan? _duration; + + /// Time elapsed for task. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.TimeSpan? Duration { get => this._duration; set => this._duration = value; } + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private string _status; + + /// The status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string _taskId; + + /// The task display name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Creates an new instance. + public DpmJobTaskDetails() + { + + } + } + /// DPM workload-specific job task details. + public partial interface IDpmJobTaskDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Time elapsed for task. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time elapsed for task.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Duration { get; set; } + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end time.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// The status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + /// The task display name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The task display name.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// DPM workload-specific job task details. + internal partial interface IDpmJobTaskDetailsInternal + + { + /// Time elapsed for task. + global::System.TimeSpan? Duration { get; set; } + /// The end time. + global::System.DateTime? EndTime { get; set; } + /// The start time. + global::System.DateTime? StartTime { get; set; } + /// The status. + string Status { get; set; } + /// The task display name. + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobTaskDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobTaskDetails.json.cs new file mode 100644 index 000000000000..8bbd8ced487f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmJobTaskDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// DPM workload-specific job task details. + public partial class DpmJobTaskDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DpmJobTaskDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonDuration ) : Duration;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmJobTaskDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DpmJobTaskDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)(null != this._duration ? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._duration)): null), "duration" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItem.cs new file mode 100644 index 000000000000..0fb03d449b4d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItem.cs @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on Backup engine specific backup item. + public partial class DpmProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(); + + /// Backing field for property. + private string _backupEngineName; + + /// Backup Management server protecting this backup item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupEngineName { get => this._backupEngineName; set => this._backupEngineName = value; } + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfo _extendedInfo; + + /// Extended info of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmProtectedItemExtendedInfo()); set => this._extendedInfo = value; } + + /// Used Disk storage in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoDiskStorageUsedInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).DiskStorageUsedInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).DiskStorageUsedInByte = value ?? null; } + + /// To check if backup item is collocated. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? ExtendedInfoIsCollocated { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).IsCollocated; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).IsCollocated = value ?? default(bool); } + + /// To check if backup item is cloud protected. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? ExtendedInfoIsPresentOnCloud { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).IsPresentOnCloud; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).IsPresentOnCloud = value ?? default(bool); } + + /// Last backup status information on backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoLastBackupStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).LastBackupStatus = value ?? null; } + + /// Last refresh time on backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoLastRefreshedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).LastRefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).LastRefreshedAt = value ?? default(global::System.DateTime); } + + /// Oldest cloud recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// latest disk recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOnPremiseLatestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OnPremiseLatestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OnPremiseLatestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Oldest disk recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOnPremiseOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OnPremiseOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OnPremiseOldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// disk recovery point count. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoOnPremiseRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OnPremiseRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OnPremiseRecoveryPointCount = value ?? default(int); } + + /// Attribute to provide information on various DBs. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath ExtendedInfoProtectableObjectLoadPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).ProtectableObjectLoadPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).ProtectableObjectLoadPath = value ?? null /* model class */; } + + /// To check if backup item is disk protected. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? ExtendedInfoProtected { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).Protected; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).Protected = value ?? default(bool); } + + /// Protection group name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoProtectionGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).ProtectionGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).ProtectionGroupName = value ?? null; } + + /// cloud recovery point count. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount = value ?? default(int); } + + /// total Disk storage in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoTotalDiskStorageSizeInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).TotalDiskStorageSizeInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).TotalDiskStorageSizeInByte = value ?? null; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the managed item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmProtectedItemExtendedInfo()); set { {_extendedInfo = value;} } } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState? _protectionState; + + /// Protection state of the backup engine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState? ProtectionState { get => this._protectionState; set => this._protectionState = value; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type = value ; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public DpmProtectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectedItem), __protectedItem); + await eventListener.AssertObjectIsValid(nameof(__protectedItem), __protectedItem); + } + } + /// Additional information on Backup engine specific backup item. + public partial interface IDpmProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem + { + /// Backup Management server protecting this backup item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup Management server protecting this backup item", + SerializedName = @"backupEngineName", + PossibleTypes = new [] { typeof(string) })] + string BackupEngineName { get; set; } + /// Used Disk storage in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Used Disk storage in bytes.", + SerializedName = @"diskStorageUsedInBytes", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoDiskStorageUsedInByte { get; set; } + /// To check if backup item is collocated. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if backup item is collocated.", + SerializedName = @"isCollocated", + PossibleTypes = new [] { typeof(bool) })] + bool? ExtendedInfoIsCollocated { get; set; } + /// To check if backup item is cloud protected. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if backup item is cloud protected.", + SerializedName = @"isPresentOnCloud", + PossibleTypes = new [] { typeof(bool) })] + bool? ExtendedInfoIsPresentOnCloud { get; set; } + /// Last backup status information on backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last backup status information on backup item.", + SerializedName = @"lastBackupStatus", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoLastBackupStatus { get; set; } + /// Last refresh time on backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last refresh time on backup item.", + SerializedName = @"lastRefreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoLastRefreshedAt { get; set; } + /// Oldest cloud recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Oldest cloud recovery point time.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// latest disk recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"latest disk recovery point time.", + SerializedName = @"onPremiseLatestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOnPremiseLatestRecoveryPoint { get; set; } + /// Oldest disk recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Oldest disk recovery point time.", + SerializedName = @"onPremiseOldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOnPremiseOldestRecoveryPoint { get; set; } + /// disk recovery point count. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"disk recovery point count.", + SerializedName = @"onPremiseRecoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoOnPremiseRecoveryPointCount { get; set; } + /// Attribute to provide information on various DBs. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Attribute to provide information on various DBs.", + SerializedName = @"protectableObjectLoadPath", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath ExtendedInfoProtectableObjectLoadPath { get; set; } + /// To check if backup item is disk protected. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if backup item is disk protected.", + SerializedName = @"protected", + PossibleTypes = new [] { typeof(bool) })] + bool? ExtendedInfoProtected { get; set; } + /// Protection group name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection group name of the backup item.", + SerializedName = @"protectionGroupName", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoProtectionGroupName { get; set; } + /// cloud recovery point count. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"cloud recovery point count.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoRecoveryPointCount { get; set; } + /// total Disk storage in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"total Disk storage in bytes.", + SerializedName = @"totalDiskStorageSizeInBytes", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoTotalDiskStorageSizeInByte { get; set; } + /// Friendly name of the managed item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the managed item", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Protection state of the backup engine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection state of the backup engine", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState? ProtectionState { get; set; } + + } + /// Additional information on Backup engine specific backup item. + internal partial interface IDpmProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal + { + /// Backup Management server protecting this backup item + string BackupEngineName { get; set; } + /// Extended info of the backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfo ExtendedInfo { get; set; } + /// Used Disk storage in bytes. + string ExtendedInfoDiskStorageUsedInByte { get; set; } + /// To check if backup item is collocated. + bool? ExtendedInfoIsCollocated { get; set; } + /// To check if backup item is cloud protected. + bool? ExtendedInfoIsPresentOnCloud { get; set; } + /// Last backup status information on backup item. + string ExtendedInfoLastBackupStatus { get; set; } + /// Last refresh time on backup item. + global::System.DateTime? ExtendedInfoLastRefreshedAt { get; set; } + /// Oldest cloud recovery point time. + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// latest disk recovery point time. + global::System.DateTime? ExtendedInfoOnPremiseLatestRecoveryPoint { get; set; } + /// Oldest disk recovery point time. + global::System.DateTime? ExtendedInfoOnPremiseOldestRecoveryPoint { get; set; } + /// disk recovery point count. + int? ExtendedInfoOnPremiseRecoveryPointCount { get; set; } + /// Attribute to provide information on various DBs. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath ExtendedInfoProtectableObjectLoadPath { get; set; } + /// To check if backup item is disk protected. + bool? ExtendedInfoProtected { get; set; } + /// Protection group name of the backup item. + string ExtendedInfoProtectionGroupName { get; set; } + /// cloud recovery point count. + int? ExtendedInfoRecoveryPointCount { get; set; } + /// total Disk storage in bytes. + string ExtendedInfoTotalDiskStorageSizeInByte { get; set; } + /// Friendly name of the managed item + string FriendlyName { get; set; } + /// Protection state of the backup engine + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState? ProtectionState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItem.json.cs new file mode 100644 index 000000000000..6a0fa2d84e41 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on Backup engine specific backup item. + public partial class DpmProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DpmProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmProtectedItemExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_backupEngineName = If( json?.PropertyT("backupEngineName"), out var __jsonBackupEngineName) ? (string)__jsonBackupEngineName : (string)BackupEngineName;} + {_protectionState = If( json?.PropertyT("protectionState"), out var __jsonProtectionState) ? (string)__jsonProtectionState : (string)ProtectionState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DpmProtectedItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectedItem?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._backupEngineName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupEngineName.ToString()) : null, "backupEngineName" ,container.Add ); + AddIf( null != (((object)this._protectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionState.ToString()) : null, "protectionState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..dce3dc2bb691 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information of DPM Protected item. + public partial class DpmProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoInternal + { + + /// Backing field for property. + private string _diskStorageUsedInByte; + + /// Used Disk storage in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DiskStorageUsedInByte { get => this._diskStorageUsedInByte; set => this._diskStorageUsedInByte = value; } + + /// Backing field for property. + private bool? _isCollocated; + + /// To check if backup item is collocated. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsCollocated { get => this._isCollocated; set => this._isCollocated = value; } + + /// Backing field for property. + private bool? _isPresentOnCloud; + + /// To check if backup item is cloud protected. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsPresentOnCloud { get => this._isPresentOnCloud; set => this._isPresentOnCloud = value; } + + /// Backing field for property. + private string _lastBackupStatus; + + /// Last backup status information on backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string LastBackupStatus { get => this._lastBackupStatus; set => this._lastBackupStatus = value; } + + /// Backing field for property. + private global::System.DateTime? _lastRefreshedAt; + + /// Last refresh time on backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? LastRefreshedAt { get => this._lastRefreshedAt; set => this._lastRefreshedAt = value; } + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPoint; + + /// Oldest cloud recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OldestRecoveryPoint { get => this._oldestRecoveryPoint; set => this._oldestRecoveryPoint = value; } + + /// Backing field for property. + private global::System.DateTime? _onPremiseLatestRecoveryPoint; + + /// latest disk recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OnPremiseLatestRecoveryPoint { get => this._onPremiseLatestRecoveryPoint; set => this._onPremiseLatestRecoveryPoint = value; } + + /// Backing field for property. + private global::System.DateTime? _onPremiseOldestRecoveryPoint; + + /// Oldest disk recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OnPremiseOldestRecoveryPoint { get => this._onPremiseOldestRecoveryPoint; set => this._onPremiseOldestRecoveryPoint = value; } + + /// Backing field for property. + private int? _onPremiseRecoveryPointCount; + + /// disk recovery point count. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? OnPremiseRecoveryPointCount { get => this._onPremiseRecoveryPointCount; set => this._onPremiseRecoveryPointCount = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath _protectableObjectLoadPath; + + /// Attribute to provide information on various DBs. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath ProtectableObjectLoadPath { get => (this._protectableObjectLoadPath = this._protectableObjectLoadPath ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmProtectedItemExtendedInfoProtectableObjectLoadPath()); set => this._protectableObjectLoadPath = value; } + + /// Backing field for property. + private bool? _protected; + + /// To check if backup item is disk protected. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? Protected { get => this._protected; set => this._protected = value; } + + /// Backing field for property. + private string _protectionGroupName; + + /// Protection group name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectionGroupName { get => this._protectionGroupName; set => this._protectionGroupName = value; } + + /// Backing field for property. + private int? _recoveryPointCount; + + /// cloud recovery point count. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? RecoveryPointCount { get => this._recoveryPointCount; set => this._recoveryPointCount = value; } + + /// Backing field for property. + private string _totalDiskStorageSizeInByte; + + /// total Disk storage in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TotalDiskStorageSizeInByte { get => this._totalDiskStorageSizeInByte; set => this._totalDiskStorageSizeInByte = value; } + + /// Creates an new instance. + public DpmProtectedItemExtendedInfo() + { + + } + } + /// Additional information of DPM Protected item. + public partial interface IDpmProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Used Disk storage in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Used Disk storage in bytes.", + SerializedName = @"diskStorageUsedInBytes", + PossibleTypes = new [] { typeof(string) })] + string DiskStorageUsedInByte { get; set; } + /// To check if backup item is collocated. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if backup item is collocated.", + SerializedName = @"isCollocated", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCollocated { get; set; } + /// To check if backup item is cloud protected. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if backup item is cloud protected.", + SerializedName = @"isPresentOnCloud", + PossibleTypes = new [] { typeof(bool) })] + bool? IsPresentOnCloud { get; set; } + /// Last backup status information on backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last backup status information on backup item.", + SerializedName = @"lastBackupStatus", + PossibleTypes = new [] { typeof(string) })] + string LastBackupStatus { get; set; } + /// Last refresh time on backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last refresh time on backup item.", + SerializedName = @"lastRefreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRefreshedAt { get; set; } + /// Oldest cloud recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Oldest cloud recovery point time.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// latest disk recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"latest disk recovery point time.", + SerializedName = @"onPremiseLatestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OnPremiseLatestRecoveryPoint { get; set; } + /// Oldest disk recovery point time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Oldest disk recovery point time.", + SerializedName = @"onPremiseOldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OnPremiseOldestRecoveryPoint { get; set; } + /// disk recovery point count. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"disk recovery point count.", + SerializedName = @"onPremiseRecoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? OnPremiseRecoveryPointCount { get; set; } + /// Attribute to provide information on various DBs. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Attribute to provide information on various DBs.", + SerializedName = @"protectableObjectLoadPath", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath ProtectableObjectLoadPath { get; set; } + /// To check if backup item is disk protected. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To check if backup item is disk protected.", + SerializedName = @"protected", + PossibleTypes = new [] { typeof(bool) })] + bool? Protected { get; set; } + /// Protection group name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection group name of the backup item.", + SerializedName = @"protectionGroupName", + PossibleTypes = new [] { typeof(string) })] + string ProtectionGroupName { get; set; } + /// cloud recovery point count. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"cloud recovery point count.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? RecoveryPointCount { get; set; } + /// total Disk storage in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"total Disk storage in bytes.", + SerializedName = @"totalDiskStorageSizeInBytes", + PossibleTypes = new [] { typeof(string) })] + string TotalDiskStorageSizeInByte { get; set; } + + } + /// Additional information of DPM Protected item. + internal partial interface IDpmProtectedItemExtendedInfoInternal + + { + /// Used Disk storage in bytes. + string DiskStorageUsedInByte { get; set; } + /// To check if backup item is collocated. + bool? IsCollocated { get; set; } + /// To check if backup item is cloud protected. + bool? IsPresentOnCloud { get; set; } + /// Last backup status information on backup item. + string LastBackupStatus { get; set; } + /// Last refresh time on backup item. + global::System.DateTime? LastRefreshedAt { get; set; } + /// Oldest cloud recovery point time. + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// latest disk recovery point time. + global::System.DateTime? OnPremiseLatestRecoveryPoint { get; set; } + /// Oldest disk recovery point time. + global::System.DateTime? OnPremiseOldestRecoveryPoint { get; set; } + /// disk recovery point count. + int? OnPremiseRecoveryPointCount { get; set; } + /// Attribute to provide information on various DBs. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath ProtectableObjectLoadPath { get; set; } + /// To check if backup item is disk protected. + bool? Protected { get; set; } + /// Protection group name of the backup item. + string ProtectionGroupName { get; set; } + /// cloud recovery point count. + int? RecoveryPointCount { get; set; } + /// total Disk storage in bytes. + string TotalDiskStorageSizeInByte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..ccc754cd035f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information of DPM Protected item. + public partial class DpmProtectedItemExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal DpmProtectedItemExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_protectableObjectLoadPath = If( json?.PropertyT("protectableObjectLoadPath"), out var __jsonProtectableObjectLoadPath) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmProtectedItemExtendedInfoProtectableObjectLoadPath.FromJson(__jsonProtectableObjectLoadPath) : ProtectableObjectLoadPath;} + {_protected = If( json?.PropertyT("protected"), out var __jsonProtected) ? (bool?)__jsonProtected : Protected;} + {_isPresentOnCloud = If( json?.PropertyT("isPresentOnCloud"), out var __jsonIsPresentOnCloud) ? (bool?)__jsonIsPresentOnCloud : IsPresentOnCloud;} + {_lastBackupStatus = If( json?.PropertyT("lastBackupStatus"), out var __jsonLastBackupStatus) ? (string)__jsonLastBackupStatus : (string)LastBackupStatus;} + {_lastRefreshedAt = If( json?.PropertyT("lastRefreshedAt"), out var __jsonLastRefreshedAt) ? global::System.DateTime.TryParse((string)__jsonLastRefreshedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastRefreshedAtValue) ? __jsonLastRefreshedAtValue : LastRefreshedAt : LastRefreshedAt;} + {_oldestRecoveryPoint = If( json?.PropertyT("oldestRecoveryPoint"), out var __jsonOldestRecoveryPoint) ? global::System.DateTime.TryParse((string)__jsonOldestRecoveryPoint, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOldestRecoveryPointValue) ? __jsonOldestRecoveryPointValue : OldestRecoveryPoint : OldestRecoveryPoint;} + {_recoveryPointCount = If( json?.PropertyT("recoveryPointCount"), out var __jsonRecoveryPointCount) ? (int?)__jsonRecoveryPointCount : RecoveryPointCount;} + {_onPremiseOldestRecoveryPoint = If( json?.PropertyT("onPremiseOldestRecoveryPoint"), out var __jsonOnPremiseOldestRecoveryPoint) ? global::System.DateTime.TryParse((string)__jsonOnPremiseOldestRecoveryPoint, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOnPremiseOldestRecoveryPointValue) ? __jsonOnPremiseOldestRecoveryPointValue : OnPremiseOldestRecoveryPoint : OnPremiseOldestRecoveryPoint;} + {_onPremiseLatestRecoveryPoint = If( json?.PropertyT("onPremiseLatestRecoveryPoint"), out var __jsonOnPremiseLatestRecoveryPoint) ? global::System.DateTime.TryParse((string)__jsonOnPremiseLatestRecoveryPoint, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOnPremiseLatestRecoveryPointValue) ? __jsonOnPremiseLatestRecoveryPointValue : OnPremiseLatestRecoveryPoint : OnPremiseLatestRecoveryPoint;} + {_onPremiseRecoveryPointCount = If( json?.PropertyT("onPremiseRecoveryPointCount"), out var __jsonOnPremiseRecoveryPointCount) ? (int?)__jsonOnPremiseRecoveryPointCount : OnPremiseRecoveryPointCount;} + {_isCollocated = If( json?.PropertyT("isCollocated"), out var __jsonIsCollocated) ? (bool?)__jsonIsCollocated : IsCollocated;} + {_protectionGroupName = If( json?.PropertyT("protectionGroupName"), out var __jsonProtectionGroupName) ? (string)__jsonProtectionGroupName : (string)ProtectionGroupName;} + {_diskStorageUsedInByte = If( json?.PropertyT("diskStorageUsedInBytes"), out var __jsonDiskStorageUsedInBytes) ? (string)__jsonDiskStorageUsedInBytes : (string)DiskStorageUsedInByte;} + {_totalDiskStorageSizeInByte = If( json?.PropertyT("totalDiskStorageSizeInBytes"), out var __jsonTotalDiskStorageSizeInBytes) ? (string)__jsonTotalDiskStorageSizeInBytes : (string)TotalDiskStorageSizeInByte;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DpmProtectedItemExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._protectableObjectLoadPath ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._protectableObjectLoadPath.ToJson(null,serializationMode) : null, "protectableObjectLoadPath" ,container.Add ); + AddIf( null != this._protected ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._protected) : null, "protected" ,container.Add ); + AddIf( null != this._isPresentOnCloud ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isPresentOnCloud) : null, "isPresentOnCloud" ,container.Add ); + AddIf( null != (((object)this._lastBackupStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastBackupStatus.ToString()) : null, "lastBackupStatus" ,container.Add ); + AddIf( null != this._lastRefreshedAt ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastRefreshedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastRefreshedAt" ,container.Add ); + AddIf( null != this._oldestRecoveryPoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oldestRecoveryPoint?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "oldestRecoveryPoint" ,container.Add ); + AddIf( null != this._recoveryPointCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._recoveryPointCount) : null, "recoveryPointCount" ,container.Add ); + AddIf( null != this._onPremiseOldestRecoveryPoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._onPremiseOldestRecoveryPoint?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "onPremiseOldestRecoveryPoint" ,container.Add ); + AddIf( null != this._onPremiseLatestRecoveryPoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._onPremiseLatestRecoveryPoint?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "onPremiseLatestRecoveryPoint" ,container.Add ); + AddIf( null != this._onPremiseRecoveryPointCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._onPremiseRecoveryPointCount) : null, "onPremiseRecoveryPointCount" ,container.Add ); + AddIf( null != this._isCollocated ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isCollocated) : null, "isCollocated" ,container.Add ); + AddIf( null != (((object)this._protectionGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionGroupName.ToString()) : null, "protectionGroupName" ,container.Add ); + AddIf( null != (((object)this._diskStorageUsedInByte)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._diskStorageUsedInByte.ToString()) : null, "diskStorageUsedInBytes" ,container.Add ); + AddIf( null != (((object)this._totalDiskStorageSizeInByte)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._totalDiskStorageSizeInByte.ToString()) : null, "totalDiskStorageSizeInBytes" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.cs new file mode 100644 index 000000000000..878a8fdc4a2d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Attribute to provide information on various DBs. + public partial class DpmProtectedItemExtendedInfoProtectableObjectLoadPath : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPathInternal + { + + /// + /// Creates an new instance. + /// + public DpmProtectedItemExtendedInfoProtectableObjectLoadPath() + { + + } + } + /// Attribute to provide information on various DBs. + public partial interface IDpmProtectedItemExtendedInfoProtectableObjectLoadPath : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Attribute to provide information on various DBs. + internal partial interface IDpmProtectedItemExtendedInfoProtectableObjectLoadPathInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.dictionary.cs new file mode 100644 index 000000000000..5f9b0f0393c3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class DpmProtectedItemExtendedInfoProtectableObjectLoadPath : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DpmProtectedItemExtendedInfoProtectableObjectLoadPath source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.json.cs new file mode 100644 index 000000000000..7307569c3675 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Attribute to provide information on various DBs. + public partial class DpmProtectedItemExtendedInfoProtectableObjectLoadPath + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal DpmProtectedItemExtendedInfoProtectableObjectLoadPath(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new DpmProtectedItemExtendedInfoProtectableObjectLoadPath(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/EncryptionDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/EncryptionDetails.cs new file mode 100644 index 000000000000..a3f0a1a2417d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/EncryptionDetails.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Details needed if the VM was encrypted at the time of backup. + public partial class EncryptionDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal + { + + /// Backing field for property. + private bool? _encryptionEnabled; + + /// + /// Identifies whether this backup copy represents an encrypted VM at the time of backup. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? EncryptionEnabled { get => this._encryptionEnabled; set => this._encryptionEnabled = value; } + + /// Backing field for property. + private string _kekUrl; + + /// Key Url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string KekUrl { get => this._kekUrl; set => this._kekUrl = value; } + + /// Backing field for property. + private string _kekVaultId; + + /// ID of Key Vault where KEK is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string KekVaultId { get => this._kekVaultId; set => this._kekVaultId = value; } + + /// Backing field for property. + private string _secretKeyUrl; + + /// Secret Url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SecretKeyUrl { get => this._secretKeyUrl; set => this._secretKeyUrl = value; } + + /// Backing field for property. + private string _secretKeyVaultId; + + /// ID of Key Vault where Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SecretKeyVaultId { get => this._secretKeyVaultId; set => this._secretKeyVaultId = value; } + + /// Creates an new instance. + public EncryptionDetails() + { + + } + } + /// Details needed if the VM was encrypted at the time of backup. + public partial interface IEncryptionDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// Identifies whether this backup copy represents an encrypted VM at the time of backup. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies whether this backup copy represents an encrypted VM at the time of backup.", + SerializedName = @"encryptionEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? EncryptionEnabled { get; set; } + /// Key Url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Url.", + SerializedName = @"kekUrl", + PossibleTypes = new [] { typeof(string) })] + string KekUrl { get; set; } + /// ID of Key Vault where KEK is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of Key Vault where KEK is stored.", + SerializedName = @"kekVaultId", + PossibleTypes = new [] { typeof(string) })] + string KekVaultId { get; set; } + /// Secret Url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secret Url.", + SerializedName = @"secretKeyUrl", + PossibleTypes = new [] { typeof(string) })] + string SecretKeyUrl { get; set; } + /// ID of Key Vault where Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of Key Vault where Secret is stored.", + SerializedName = @"secretKeyVaultId", + PossibleTypes = new [] { typeof(string) })] + string SecretKeyVaultId { get; set; } + + } + /// Details needed if the VM was encrypted at the time of backup. + internal partial interface IEncryptionDetailsInternal + + { + /// + /// Identifies whether this backup copy represents an encrypted VM at the time of backup. + /// + bool? EncryptionEnabled { get; set; } + /// Key Url. + string KekUrl { get; set; } + /// ID of Key Vault where KEK is stored. + string KekVaultId { get; set; } + /// Secret Url. + string SecretKeyUrl { get; set; } + /// ID of Key Vault where Secret is stored. + string SecretKeyVaultId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/EncryptionDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/EncryptionDetails.json.cs new file mode 100644 index 000000000000..eb20b58be235 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/EncryptionDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Details needed if the VM was encrypted at the time of backup. + public partial class EncryptionDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal EncryptionDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_encryptionEnabled = If( json?.PropertyT("encryptionEnabled"), out var __jsonEncryptionEnabled) ? (bool?)__jsonEncryptionEnabled : EncryptionEnabled;} + {_kekUrl = If( json?.PropertyT("kekUrl"), out var __jsonKekUrl) ? (string)__jsonKekUrl : (string)KekUrl;} + {_secretKeyUrl = If( json?.PropertyT("secretKeyUrl"), out var __jsonSecretKeyUrl) ? (string)__jsonSecretKeyUrl : (string)SecretKeyUrl;} + {_kekVaultId = If( json?.PropertyT("kekVaultId"), out var __jsonKekVaultId) ? (string)__jsonKekVaultId : (string)KekVaultId;} + {_secretKeyVaultId = If( json?.PropertyT("secretKeyVaultId"), out var __jsonSecretKeyVaultId) ? (string)__jsonSecretKeyVaultId : (string)SecretKeyVaultId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new EncryptionDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._encryptionEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._encryptionEnabled) : null, "encryptionEnabled" ,container.Add ); + AddIf( null != (((object)this._kekUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._kekUrl.ToString()) : null, "kekUrl" ,container.Add ); + AddIf( null != (((object)this._secretKeyUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._secretKeyUrl.ToString()) : null, "secretKeyUrl" ,container.Add ); + AddIf( null != (((object)this._kekVaultId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._kekVaultId.ToString()) : null, "kekVaultId" ,container.Add ); + AddIf( null != (((object)this._secretKeyVaultId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._secretKeyVaultId.ToString()) : null, "secretKeyVaultId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ErrorDetail.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ErrorDetail.cs new file mode 100644 index 000000000000..1c8c42a9cc46 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ErrorDetail.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Error Detail class which encapsulates Code, Message and Recommendations. + public partial class ErrorDetail : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal + { + + /// Backing field for property. + private string _code; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private string _message; + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal.Recommendation { get => this._recommendation; set { {_recommendation = value;} } } + + /// Backing field for property. + private string[] _recommendation; + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; } + + /// Creates an new instance. + public ErrorDetail() + { + + } + } + /// Error Detail class which encapsulates Code, Message and Recommendations. + public partial interface IErrorDetail : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message related to the Code.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of recommendation strings.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; } + + } + /// Error Detail class which encapsulates Code, Message and Recommendations. + internal partial interface IErrorDetailInternal + + { + /// Error code. + string Code { get; set; } + /// Error Message related to the Code. + string Message { get; set; } + /// List of recommendation strings. + string[] Recommendation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ErrorDetail.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ErrorDetail.json.cs new file mode 100644 index 000000000000..479076fddc79 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ErrorDetail.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Error Detail class which encapsulates Code, Message and Recommendations. + public partial class ErrorDetail + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_recommendation = If( json?.PropertyT("recommendations"), out var __jsonRecommendations) ? If( __jsonRecommendations as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Recommendation;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ErrorDetail(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExportJobsOperationResultInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExportJobsOperationResultInfo.cs new file mode 100644 index 000000000000..70542d2c5fe2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExportJobsOperationResultInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// This class is used to send blob details after exporting jobs. + public partial class ExportJobsOperationResultInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExportJobsOperationResultInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExportJobsOperationResultInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase __operationResultInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationResultInfoBase(); + + /// Backing field for property. + private string _blobSasKey; + + /// SAS key to access the blob. It expires in 15 mins. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BlobSasKey { get => this._blobSasKey; set => this._blobSasKey = value; } + + /// Backing field for property. + private string _blobUrl; + + /// URL of the blob into which the serialized string of list of jobs is exported. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BlobUrl { get => this._blobUrl; set => this._blobUrl = value; } + + /// Backing field for property. + private string _excelFileBlobSasKey; + + /// SAS key to access the blob. It expires in 15 mins. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ExcelFileBlobSasKey { get => this._excelFileBlobSasKey; set => this._excelFileBlobSasKey = value; } + + /// Backing field for property. + private string _excelFileBlobUrl; + + /// URL of the blob into which the ExcelFile is uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ExcelFileBlobUrl { get => this._excelFileBlobUrl; set => this._excelFileBlobUrl = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseInternal)__operationResultInfoBase).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseInternal)__operationResultInfoBase).ObjectType = value ; } + + /// Creates an new instance. + public ExportJobsOperationResultInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__operationResultInfoBase), __operationResultInfoBase); + await eventListener.AssertObjectIsValid(nameof(__operationResultInfoBase), __operationResultInfoBase); + } + } + /// This class is used to send blob details after exporting jobs. + public partial interface IExportJobsOperationResultInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase + { + /// SAS key to access the blob. It expires in 15 mins. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SAS key to access the blob. It expires in 15 mins.", + SerializedName = @"blobSasKey", + PossibleTypes = new [] { typeof(string) })] + string BlobSasKey { get; set; } + /// URL of the blob into which the serialized string of list of jobs is exported. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL of the blob into which the serialized string of list of jobs is exported.", + SerializedName = @"blobUrl", + PossibleTypes = new [] { typeof(string) })] + string BlobUrl { get; set; } + /// SAS key to access the blob. It expires in 15 mins. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SAS key to access the blob. It expires in 15 mins.", + SerializedName = @"excelFileBlobSasKey", + PossibleTypes = new [] { typeof(string) })] + string ExcelFileBlobSasKey { get; set; } + /// URL of the blob into which the ExcelFile is uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL of the blob into which the ExcelFile is uploaded.", + SerializedName = @"excelFileBlobUrl", + PossibleTypes = new [] { typeof(string) })] + string ExcelFileBlobUrl { get; set; } + + } + /// This class is used to send blob details after exporting jobs. + internal partial interface IExportJobsOperationResultInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseInternal + { + /// SAS key to access the blob. It expires in 15 mins. + string BlobSasKey { get; set; } + /// URL of the blob into which the serialized string of list of jobs is exported. + string BlobUrl { get; set; } + /// SAS key to access the blob. It expires in 15 mins. + string ExcelFileBlobSasKey { get; set; } + /// URL of the blob into which the ExcelFile is uploaded. + string ExcelFileBlobUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExportJobsOperationResultInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExportJobsOperationResultInfo.json.cs new file mode 100644 index 000000000000..0fc00f35a8ba --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExportJobsOperationResultInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// This class is used to send blob details after exporting jobs. + public partial class ExportJobsOperationResultInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ExportJobsOperationResultInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __operationResultInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationResultInfoBase(json); + {_blobUrl = If( json?.PropertyT("blobUrl"), out var __jsonBlobUrl) ? (string)__jsonBlobUrl : (string)BlobUrl;} + {_blobSasKey = If( json?.PropertyT("blobSasKey"), out var __jsonBlobSasKey) ? (string)__jsonBlobSasKey : (string)BlobSasKey;} + {_excelFileBlobUrl = If( json?.PropertyT("excelFileBlobUrl"), out var __jsonExcelFileBlobUrl) ? (string)__jsonExcelFileBlobUrl : (string)ExcelFileBlobUrl;} + {_excelFileBlobSasKey = If( json?.PropertyT("excelFileBlobSasKey"), out var __jsonExcelFileBlobSasKey) ? (string)__jsonExcelFileBlobSasKey : (string)ExcelFileBlobSasKey;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExportJobsOperationResultInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExportJobsOperationResultInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExportJobsOperationResultInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ExportJobsOperationResultInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __operationResultInfoBase?.ToJson(container, serializationMode); + AddIf( null != (((object)this._blobUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._blobUrl.ToString()) : null, "blobUrl" ,container.Add ); + AddIf( null != (((object)this._blobSasKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._blobSasKey.ToString()) : null, "blobSasKey" ,container.Add ); + AddIf( null != (((object)this._excelFileBlobUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._excelFileBlobUrl.ToString()) : null, "excelFileBlobUrl" ,container.Add ); + AddIf( null != (((object)this._excelFileBlobSasKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._excelFileBlobSasKey.ToString()) : null, "excelFileBlobSasKey" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExtendedProperties.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExtendedProperties.cs new file mode 100644 index 000000000000..be96b2aea721 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExtendedProperties.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Extended Properties for Azure IaasVM Backup. + public partial class ExtendedProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedProperties, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties _diskExclusionProperty; + + /// Extended Properties for Disk Exclusion. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties DiskExclusionProperty { get => (this._diskExclusionProperty = this._diskExclusionProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DiskExclusionProperties()); set => this._diskExclusionProperty = value; } + + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int[] DiskExclusionPropertyDiskLunList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionPropertiesInternal)DiskExclusionProperty).DiskLunList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionPropertiesInternal)DiskExclusionProperty).DiskLunList = value ?? null /* arrayOf */; } + + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? DiskExclusionPropertyIsInclusionList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionPropertiesInternal)DiskExclusionProperty).IsInclusionList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionPropertiesInternal)DiskExclusionProperty).IsInclusionList = value ?? default(bool); } + + /// Backing field for property. + private string _linuxVMApplicationName; + + /// Linux VM name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string LinuxVMApplicationName { get => this._linuxVMApplicationName; set => this._linuxVMApplicationName = value; } + + /// Internal Acessors for DiskExclusionProperty + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedPropertiesInternal.DiskExclusionProperty { get => (this._diskExclusionProperty = this._diskExclusionProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DiskExclusionProperties()); set { {_diskExclusionProperty = value;} } } + + /// Creates an new instance. + public ExtendedProperties() + { + + } + } + /// Extended Properties for Azure IaasVM Backup. + public partial interface IExtendedProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection.", + SerializedName = @"diskLunList", + PossibleTypes = new [] { typeof(int) })] + int[] DiskExclusionPropertyDiskLunList { get; set; } + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to indicate whether DiskLunList is to be included/ excluded from backup.", + SerializedName = @"isInclusionList", + PossibleTypes = new [] { typeof(bool) })] + bool? DiskExclusionPropertyIsInclusionList { get; set; } + /// Linux VM name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Linux VM name", + SerializedName = @"linuxVmApplicationName", + PossibleTypes = new [] { typeof(string) })] + string LinuxVMApplicationName { get; set; } + + } + /// Extended Properties for Azure IaasVM Backup. + internal partial interface IExtendedPropertiesInternal + + { + /// Extended Properties for Disk Exclusion. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskExclusionProperties DiskExclusionProperty { get; set; } + /// List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + int[] DiskExclusionPropertyDiskLunList { get; set; } + /// Flag to indicate whether DiskLunList is to be included/ excluded from backup. + bool? DiskExclusionPropertyIsInclusionList { get; set; } + /// Linux VM name + string LinuxVMApplicationName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExtendedProperties.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExtendedProperties.json.cs new file mode 100644 index 000000000000..8ac060c4384a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ExtendedProperties.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Extended Properties for Azure IaasVM Backup. + public partial class ExtendedProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ExtendedProperties(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_diskExclusionProperty = If( json?.PropertyT("diskExclusionProperties"), out var __jsonDiskExclusionProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DiskExclusionProperties.FromJson(__jsonDiskExclusionProperties) : DiskExclusionProperty;} + {_linuxVMApplicationName = If( json?.PropertyT("linuxVmApplicationName"), out var __jsonLinuxVMApplicationName) ? (string)__jsonLinuxVMApplicationName : (string)LinuxVMApplicationName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IExtendedProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ExtendedProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._diskExclusionProperty ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._diskExclusionProperty.ToJson(null,serializationMode) : null, "diskExclusionProperties" ,container.Add ); + AddIf( null != (((object)this._linuxVMApplicationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._linuxVMApplicationName.ToString()) : null, "linuxVmApplicationName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/FeatureSupportRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/FeatureSupportRequest.cs new file mode 100644 index 000000000000..a1e4f8d1d5d1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/FeatureSupportRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for feature request + public partial class FeatureSupportRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequestInternal + { + + /// Backing field for property. + private string _featureType; + + /// backup support feature type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FeatureType { get => this._featureType; set => this._featureType = value; } + + /// Creates an new instance. + public FeatureSupportRequest() + { + + } + } + /// Base class for feature request + public partial interface IFeatureSupportRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// backup support feature type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"backup support feature type.", + SerializedName = @"featureType", + PossibleTypes = new [] { typeof(string) })] + string FeatureType { get; set; } + + } + /// Base class for feature request + internal partial interface IFeatureSupportRequestInternal + + { + /// backup support feature type. + string FeatureType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/FeatureSupportRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/FeatureSupportRequest.json.cs new file mode 100644 index 000000000000..1e9e4d855914 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/FeatureSupportRequest.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for feature request + public partial class FeatureSupportRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal FeatureSupportRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_featureType = If( json?.PropertyT("featureType"), out var __jsonFeatureType) ? (string)__jsonFeatureType : (string)FeatureType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("featureType") ) + { + case "AzureBackupGoals": + { + return new AzureBackupGoalFeatureSupportRequest(json); + } + case "AzureVMResourceBackup": + { + return new AzureVMResourceFeatureSupportRequest(json); + } + } + return new FeatureSupportRequest(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._featureType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._featureType.ToString()) : null, "featureType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainer.cs new file mode 100644 index 000000000000..47d65da0b8fe --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainer.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for generic container of backup items + public partial class GenericContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Protection container identity - AAD Tenant + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerIdentityInfoAadTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ContainerIdentityInfoAadTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ContainerIdentityInfoAadTenantId = value ?? null; } + + /// Protection container identity - Audience + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerIdentityInfoAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ContainerIdentityInfoAudience; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ContainerIdentityInfoAudience = value ?? null; } + + /// Protection container identity - AAD Service Principal + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerIdentityInfoServicePrincipalClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ContainerIdentityInfoServicePrincipalClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ContainerIdentityInfoServicePrincipalClientId = value ?? null; } + + /// Unique name of the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerIdentityInfoUniqueName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ContainerIdentityInfoUniqueName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ContainerIdentityInfoUniqueName = value ?? null; } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfo _extendedInformation; + + /// Extended information (not returned in List container API calls) + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfo ExtendedInformation { get => (this._extendedInformation = this._extendedInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.GenericContainerExtendedInfo()); set => this._extendedInformation = value; } + + /// Public key of container cert + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInformationRawCertData { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).RawCertData; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).RawCertData = value ?? null; } + + /// Azure Backup Service Endpoints for the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints ExtendedInformationServiceEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ServiceEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ServiceEndpoint = value ?? null /* model class */; } + + /// Backing field for property. + private string _fabricName; + + /// Name of the container's fabric + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus = value ?? null; } + + /// Internal Acessors for ExtendedInformation + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerInternal.ExtendedInformation { get => (this._extendedInformation = this._extendedInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.GenericContainerExtendedInfo()); set { {_extendedInformation = value;} } } + + /// Internal Acessors for ExtendedInformationContainerIdentityInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerInternal.ExtendedInformationContainerIdentityInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ContainerIdentityInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal)ExtendedInformation).ContainerIdentityInfo = value; } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType = value ?? null; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus = value ?? null; } + + /// Creates an new instance. + public GenericContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionContainer), __protectionContainer); + await eventListener.AssertObjectIsValid(nameof(__protectionContainer), __protectionContainer); + } + } + /// Base class for generic container of backup items + public partial interface IGenericContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer + { + /// Protection container identity - AAD Tenant + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection container identity - AAD Tenant", + SerializedName = @"aadTenantId", + PossibleTypes = new [] { typeof(string) })] + string ContainerIdentityInfoAadTenantId { get; set; } + /// Protection container identity - Audience + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection container identity - Audience", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + string ContainerIdentityInfoAudience { get; set; } + /// Protection container identity - AAD Service Principal + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection container identity - AAD Service Principal", + SerializedName = @"servicePrincipalClientId", + PossibleTypes = new [] { typeof(string) })] + string ContainerIdentityInfoServicePrincipalClientId { get; set; } + /// Unique name of the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique name of the container", + SerializedName = @"uniqueName", + PossibleTypes = new [] { typeof(string) })] + string ContainerIdentityInfoUniqueName { get; set; } + /// Public key of container cert + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Public key of container cert", + SerializedName = @"rawCertData", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInformationRawCertData { get; set; } + /// Azure Backup Service Endpoints for the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Backup Service Endpoints for the container", + SerializedName = @"serviceEndpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints ExtendedInformationServiceEndpoint { get; set; } + /// Name of the container's fabric + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the container's fabric", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + string FabricName { get; set; } + + } + /// Base class for generic container of backup items + internal partial interface IGenericContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal + { + /// Protection container identity - AAD Tenant + string ContainerIdentityInfoAadTenantId { get; set; } + /// Protection container identity - Audience + string ContainerIdentityInfoAudience { get; set; } + /// Protection container identity - AAD Service Principal + string ContainerIdentityInfoServicePrincipalClientId { get; set; } + /// Unique name of the container + string ContainerIdentityInfoUniqueName { get; set; } + /// Extended information (not returned in List container API calls) + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfo ExtendedInformation { get; set; } + /// Container identity information + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfo ExtendedInformationContainerIdentityInfo { get; set; } + /// Public key of container cert + string ExtendedInformationRawCertData { get; set; } + /// Azure Backup Service Endpoints for the container + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints ExtendedInformationServiceEndpoint { get; set; } + /// Name of the container's fabric + string FabricName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainer.json.cs new file mode 100644 index 000000000000..cf61f6381ce8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for generic container of backup items + public partial class GenericContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new GenericContainer(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal GenericContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(json); + {_extendedInformation = If( json?.PropertyT("extendedInformation"), out var __jsonExtendedInformation) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.GenericContainerExtendedInfo.FromJson(__jsonExtendedInformation) : ExtendedInformation;} + {_fabricName = If( json?.PropertyT("fabricName"), out var __jsonFabricName) ? (string)__jsonFabricName : (string)FabricName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionContainer?.ToJson(container, serializationMode); + AddIf( null != this._extendedInformation ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInformation.ToJson(null,serializationMode) : null, "extendedInformation" ,container.Add ); + AddIf( null != (((object)this._fabricName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._fabricName.ToString()) : null, "fabricName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfo.cs new file mode 100644 index 000000000000..84861e6913ed --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container extended information + public partial class GenericContainerExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfo _containerIdentityInfo; + + /// Container identity information + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfo ContainerIdentityInfo { get => (this._containerIdentityInfo = this._containerIdentityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ContainerIdentityInfo()); set => this._containerIdentityInfo = value; } + + /// Protection container identity - AAD Tenant + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerIdentityInfoAadTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfoInternal)ContainerIdentityInfo).AadTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfoInternal)ContainerIdentityInfo).AadTenantId = value ?? null; } + + /// Protection container identity - Audience + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerIdentityInfoAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfoInternal)ContainerIdentityInfo).Audience; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfoInternal)ContainerIdentityInfo).Audience = value ?? null; } + + /// Protection container identity - AAD Service Principal + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerIdentityInfoServicePrincipalClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfoInternal)ContainerIdentityInfo).ServicePrincipalClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfoInternal)ContainerIdentityInfo).ServicePrincipalClientId = value ?? null; } + + /// Unique name of the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerIdentityInfoUniqueName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfoInternal)ContainerIdentityInfo).UniqueName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfoInternal)ContainerIdentityInfo).UniqueName = value ?? null; } + + /// Internal Acessors for ContainerIdentityInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoInternal.ContainerIdentityInfo { get => (this._containerIdentityInfo = this._containerIdentityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ContainerIdentityInfo()); set { {_containerIdentityInfo = value;} } } + + /// Backing field for property. + private string _rawCertData; + + /// Public key of container cert + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RawCertData { get => this._rawCertData; set => this._rawCertData = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints _serviceEndpoint; + + /// Azure Backup Service Endpoints for the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints ServiceEndpoint { get => (this._serviceEndpoint = this._serviceEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.GenericContainerExtendedInfoServiceEndpoints()); set => this._serviceEndpoint = value; } + + /// Creates an new instance. + public GenericContainerExtendedInfo() + { + + } + } + /// Container extended information + public partial interface IGenericContainerExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Protection container identity - AAD Tenant + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection container identity - AAD Tenant", + SerializedName = @"aadTenantId", + PossibleTypes = new [] { typeof(string) })] + string ContainerIdentityInfoAadTenantId { get; set; } + /// Protection container identity - Audience + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection container identity - Audience", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + string ContainerIdentityInfoAudience { get; set; } + /// Protection container identity - AAD Service Principal + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protection container identity - AAD Service Principal", + SerializedName = @"servicePrincipalClientId", + PossibleTypes = new [] { typeof(string) })] + string ContainerIdentityInfoServicePrincipalClientId { get; set; } + /// Unique name of the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique name of the container", + SerializedName = @"uniqueName", + PossibleTypes = new [] { typeof(string) })] + string ContainerIdentityInfoUniqueName { get; set; } + /// Public key of container cert + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Public key of container cert", + SerializedName = @"rawCertData", + PossibleTypes = new [] { typeof(string) })] + string RawCertData { get; set; } + /// Azure Backup Service Endpoints for the container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Backup Service Endpoints for the container", + SerializedName = @"serviceEndpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints ServiceEndpoint { get; set; } + + } + /// Container extended information + internal partial interface IGenericContainerExtendedInfoInternal + + { + /// Container identity information + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IContainerIdentityInfo ContainerIdentityInfo { get; set; } + /// Protection container identity - AAD Tenant + string ContainerIdentityInfoAadTenantId { get; set; } + /// Protection container identity - Audience + string ContainerIdentityInfoAudience { get; set; } + /// Protection container identity - AAD Service Principal + string ContainerIdentityInfoServicePrincipalClientId { get; set; } + /// Unique name of the container + string ContainerIdentityInfoUniqueName { get; set; } + /// Public key of container cert + string RawCertData { get; set; } + /// Azure Backup Service Endpoints for the container + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints ServiceEndpoint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfo.json.cs new file mode 100644 index 000000000000..962d1efb4779 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container extended information + public partial class GenericContainerExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new GenericContainerExtendedInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal GenericContainerExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_containerIdentityInfo = If( json?.PropertyT("containerIdentityInfo"), out var __jsonContainerIdentityInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ContainerIdentityInfo.FromJson(__jsonContainerIdentityInfo) : ContainerIdentityInfo;} + {_rawCertData = If( json?.PropertyT("rawCertData"), out var __jsonRawCertData) ? (string)__jsonRawCertData : (string)RawCertData;} + {_serviceEndpoint = If( json?.PropertyT("serviceEndpoints"), out var __jsonServiceEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.GenericContainerExtendedInfoServiceEndpoints.FromJson(__jsonServiceEndpoints) : ServiceEndpoint;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._containerIdentityInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._containerIdentityInfo.ToJson(null,serializationMode) : null, "containerIdentityInfo" ,container.Add ); + AddIf( null != (((object)this._rawCertData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._rawCertData.ToString()) : null, "rawCertData" ,container.Add ); + AddIf( null != this._serviceEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._serviceEndpoint.ToJson(null,serializationMode) : null, "serviceEndpoints" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.cs new file mode 100644 index 000000000000..84ae87c5bfc9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Backup Service Endpoints for the container + public partial class GenericContainerExtendedInfoServiceEndpoints : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpointsInternal + { + + /// + /// Creates an new instance. + /// + public GenericContainerExtendedInfoServiceEndpoints() + { + + } + } + /// Azure Backup Service Endpoints for the container + public partial interface IGenericContainerExtendedInfoServiceEndpoints : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Azure Backup Service Endpoints for the container + internal partial interface IGenericContainerExtendedInfoServiceEndpointsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.dictionary.cs new file mode 100644 index 000000000000..dedd0528fd56 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class GenericContainerExtendedInfoServiceEndpoints : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.GenericContainerExtendedInfoServiceEndpoints source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.json.cs new file mode 100644 index 000000000000..9a00b73dcd14 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericContainerExtendedInfoServiceEndpoints.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure Backup Service Endpoints for the container + public partial class GenericContainerExtendedInfoServiceEndpoints + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericContainerExtendedInfoServiceEndpoints FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new GenericContainerExtendedInfoServiceEndpoints(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal GenericContainerExtendedInfoServiceEndpoints(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItem.cs new file mode 100644 index 000000000000..fe0aed435118 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItem.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup items. + public partial class GenericProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private string _fabricName; + + /// Name of this backup item's fabric. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName = value ?? null; } + + /// Backing field for property. + private string _policyState; + + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyState { get => this._policyState; set => this._policyState = value; } + + /// Backing field for property. + private long? _protectedItemId; + + /// Data Plane Service ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? ProtectedItemId { get => this._protectedItemId; set => this._protectedItemId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? _protectionState; + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get => this._protectionState; set => this._protectionState = value; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemSourceAssociations _sourceAssociation; + + /// + /// Loosely coupled (type, value) associations (example - parent of a protected item) + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemSourceAssociations SourceAssociation { get => (this._sourceAssociation = this._sourceAssociation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.GenericProtectedItemSourceAssociations()); set => this._sourceAssociation = value; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type = value ; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public GenericProtectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectedItem), __protectedItem); + await eventListener.AssertObjectIsValid(nameof(__protectedItem), __protectedItem); + } + } + /// Base class for backup items. + public partial interface IGenericProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem + { + /// Name of this backup item's fabric. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of this backup item's fabric.", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + string FabricName { get; set; } + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the container.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates consistency of policy object and policy applied to this backup item.", + SerializedName = @"policyState", + PossibleTypes = new [] { typeof(string) })] + string PolicyState { get; set; } + /// Data Plane Service ID of the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Plane Service ID of the protected item.", + SerializedName = @"protectedItemId", + PossibleTypes = new [] { typeof(long) })] + long? ProtectedItemId { get; set; } + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup state of this backup item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get; set; } + /// + /// Loosely coupled (type, value) associations (example - parent of a protected item) + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Loosely coupled (type, value) associations (example - parent of a protected item)", + SerializedName = @"sourceAssociations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemSourceAssociations) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemSourceAssociations SourceAssociation { get; set; } + + } + /// Base class for backup items. + internal partial interface IGenericProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal + { + /// Name of this backup item's fabric. + string FabricName { get; set; } + /// Friendly name of the container. + string FriendlyName { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + string PolicyState { get; set; } + /// Data Plane Service ID of the protected item. + long? ProtectedItemId { get; set; } + /// Backup state of this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState? ProtectionState { get; set; } + /// + /// Loosely coupled (type, value) associations (example - parent of a protected item) + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemSourceAssociations SourceAssociation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItem.json.cs new file mode 100644 index 000000000000..392f08d6c114 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItem.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup items. + public partial class GenericProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new GenericProtectedItem(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal GenericProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(json); + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_policyState = If( json?.PropertyT("policyState"), out var __jsonPolicyState) ? (string)__jsonPolicyState : (string)PolicyState;} + {_protectionState = If( json?.PropertyT("protectionState"), out var __jsonProtectionState) ? (string)__jsonProtectionState : (string)ProtectionState;} + {_protectedItemId = If( json?.PropertyT("protectedItemId"), out var __jsonProtectedItemId) ? (long?)__jsonProtectedItemId : ProtectedItemId;} + {_sourceAssociation = If( json?.PropertyT("sourceAssociations"), out var __jsonSourceAssociations) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.GenericProtectedItemSourceAssociations.FromJson(__jsonSourceAssociations) : SourceAssociation;} + {_fabricName = If( json?.PropertyT("fabricName"), out var __jsonFabricName) ? (string)__jsonFabricName : (string)FabricName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectedItem?.ToJson(container, serializationMode); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._policyState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyState.ToString()) : null, "policyState" ,container.Add ); + AddIf( null != (((object)this._protectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionState.ToString()) : null, "protectionState" ,container.Add ); + AddIf( null != this._protectedItemId ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._protectedItemId) : null, "protectedItemId" ,container.Add ); + AddIf( null != this._sourceAssociation ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._sourceAssociation.ToJson(null,serializationMode) : null, "sourceAssociations" ,container.Add ); + AddIf( null != (((object)this._fabricName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._fabricName.ToString()) : null, "fabricName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.cs new file mode 100644 index 000000000000..173514635896 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Loosely coupled (type, value) associations (example - parent of a protected item) + /// + public partial class GenericProtectedItemSourceAssociations : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemSourceAssociations, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemSourceAssociationsInternal + { + + /// Creates an new instance. + public GenericProtectedItemSourceAssociations() + { + + } + } + /// Loosely coupled (type, value) associations (example - parent of a protected item) + public partial interface IGenericProtectedItemSourceAssociations : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Loosely coupled (type, value) associations (example - parent of a protected item) + internal partial interface IGenericProtectedItemSourceAssociationsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.dictionary.cs new file mode 100644 index 000000000000..e4d3ca6bcf2a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class GenericProtectedItemSourceAssociations : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.GenericProtectedItemSourceAssociations source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.json.cs new file mode 100644 index 000000000000..012c18db81f0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectedItemSourceAssociations.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Loosely coupled (type, value) associations (example - parent of a protected item) + /// + public partial class GenericProtectedItemSourceAssociations + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemSourceAssociations. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemSourceAssociations. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectedItemSourceAssociations FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new GenericProtectedItemSourceAssociations(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal GenericProtectedItemSourceAssociations(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectionPolicy.cs new file mode 100644 index 000000000000..e2b005f996bf --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectionPolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM (Mercury) workload-specific backup policy. + public partial class GenericProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectionPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType = value ; } + + /// Backing field for property. + private string _fabricName; + + /// Name of this policy's fabric. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// Number of items associated with this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount = value ?? default(int); } + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy[] _subProtectionPolicy; + + /// List of sub-protection policies which includes schedule and retention + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy[] SubProtectionPolicy { get => this._subProtectionPolicy; set => this._subProtectionPolicy = value; } + + /// Backing field for property. + private string _timeZone; + + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TimeZone { get => this._timeZone; set => this._timeZone = value; } + + /// Creates an new instance. + public GenericProtectionPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionPolicy), __protectionPolicy); + await eventListener.AssertObjectIsValid(nameof(__protectionPolicy), __protectionPolicy); + } + } + /// Azure VM (Mercury) workload-specific backup policy. + public partial interface IGenericProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy + { + /// Name of this policy's fabric. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of this policy's fabric.", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + string FabricName { get; set; } + /// List of sub-protection policies which includes schedule and retention + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of sub-protection policies which includes schedule and retention", + SerializedName = @"subProtectionPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy[] SubProtectionPolicy { get; set; } + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"TimeZone optional input as string. For example: TimeZone = ""Pacific Standard Time"".", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string TimeZone { get; set; } + + } + /// Azure VM (Mercury) workload-specific backup policy. + internal partial interface IGenericProtectionPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal + { + /// Name of this policy's fabric. + string FabricName { get; set; } + /// List of sub-protection policies which includes schedule and retention + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy[] SubProtectionPolicy { get; set; } + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + string TimeZone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectionPolicy.json.cs new file mode 100644 index 000000000000..21d19c756b75 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericProtectionPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure VM (Mercury) workload-specific backup policy. + public partial class GenericProtectionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericProtectionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new GenericProtectionPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal GenericProtectionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(json); + {_subProtectionPolicy = If( json?.PropertyT("subProtectionPolicy"), out var __jsonSubProtectionPolicy) ? If( __jsonSubProtectionPolicy as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SubProtectionPolicy.FromJson(__u) )) ))() : null : SubProtectionPolicy;} + {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)TimeZone;} + {_fabricName = If( json?.PropertyT("fabricName"), out var __jsonFabricName) ? (string)__jsonFabricName : (string)FabricName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionPolicy?.ToJson(container, serializationMode); + if (null != this._subProtectionPolicy) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._subProtectionPolicy ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("subProtectionPolicy",__w); + } + AddIf( null != (((object)this._timeZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._timeZone.ToString()) : null, "timeZone" ,container.Add ); + AddIf( null != (((object)this._fabricName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._fabricName.ToString()) : null, "fabricName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericRecoveryPoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericRecoveryPoint.cs new file mode 100644 index 000000000000..3b4707659a90 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericRecoveryPoint.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Generic backup copy. + public partial class GenericRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint(); + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__recoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__recoveryPoint).ObjectType = value ; } + + /// Backing field for property. + private string _recoveryPointAdditionalInfo; + + /// Additional information associated with this backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryPointAdditionalInfo { get => this._recoveryPointAdditionalInfo; set => this._recoveryPointAdditionalInfo = value; } + + /// Backing field for property. + private global::System.DateTime? _recoveryPointTime; + + /// Time at which this backup copy was created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? RecoveryPointTime { get => this._recoveryPointTime; set => this._recoveryPointTime = value; } + + /// Backing field for property. + private string _recoveryPointType; + + /// Type of the backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryPointType { get => this._recoveryPointType; set => this._recoveryPointType = value; } + + /// Creates an new instance. + public GenericRecoveryPoint() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__recoveryPoint), __recoveryPoint); + await eventListener.AssertObjectIsValid(nameof(__recoveryPoint), __recoveryPoint); + } + } + /// Generic backup copy. + public partial interface IGenericRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint + { + /// Friendly name of the backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the backup copy.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Additional information associated with this backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional information associated with this backup copy.", + SerializedName = @"recoveryPointAdditionalInfo", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointAdditionalInfo { get; set; } + /// Time at which this backup copy was created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time at which this backup copy was created.", + SerializedName = @"recoveryPointTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecoveryPointTime { get; set; } + /// Type of the backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the backup copy.", + SerializedName = @"recoveryPointType", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointType { get; set; } + + } + /// Generic backup copy. + internal partial interface IGenericRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal + { + /// Friendly name of the backup copy. + string FriendlyName { get; set; } + /// Additional information associated with this backup copy. + string RecoveryPointAdditionalInfo { get; set; } + /// Time at which this backup copy was created. + global::System.DateTime? RecoveryPointTime { get; set; } + /// Type of the backup copy. + string RecoveryPointType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericRecoveryPoint.json.cs new file mode 100644 index 000000000000..1d0bb71a154b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GenericRecoveryPoint.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Generic backup copy. + public partial class GenericRecoveryPoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGenericRecoveryPoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new GenericRecoveryPoint(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal GenericRecoveryPoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint(json); + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_recoveryPointType = If( json?.PropertyT("recoveryPointType"), out var __jsonRecoveryPointType) ? (string)__jsonRecoveryPointType : (string)RecoveryPointType;} + {_recoveryPointTime = If( json?.PropertyT("recoveryPointTime"), out var __jsonRecoveryPointTime) ? global::System.DateTime.TryParse((string)__jsonRecoveryPointTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRecoveryPointTimeValue) ? __jsonRecoveryPointTimeValue : RecoveryPointTime : RecoveryPointTime;} + {_recoveryPointAdditionalInfo = If( json?.PropertyT("recoveryPointAdditionalInfo"), out var __jsonRecoveryPointAdditionalInfo) ? (string)__jsonRecoveryPointAdditionalInfo : (string)RecoveryPointAdditionalInfo;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __recoveryPoint?.ToJson(container, serializationMode); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._recoveryPointType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointType.ToString()) : null, "recoveryPointType" ,container.Add ); + AddIf( null != this._recoveryPointTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "recoveryPointTime" ,container.Add ); + AddIf( null != (((object)this._recoveryPointAdditionalInfo)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointAdditionalInfo.ToString()) : null, "recoveryPointAdditionalInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GetProtectedItemQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GetProtectedItemQueryObject.cs new file mode 100644 index 000000000000..9ef642ff9444 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GetProtectedItemQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list backup items. + public partial class GetProtectedItemQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGetProtectedItemQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGetProtectedItemQueryObjectInternal + { + + /// Backing field for property. + private string _expand; + + /// Specifies if the additional information should be provided for this item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Creates an new instance. + public GetProtectedItemQueryObject() + { + + } + } + /// Filters to list backup items. + public partial interface IGetProtectedItemQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Specifies if the additional information should be provided for this item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the additional information should be provided for this item.", + SerializedName = @"expand", + PossibleTypes = new [] { typeof(string) })] + string Expand { get; set; } + + } + /// Filters to list backup items. + internal partial interface IGetProtectedItemQueryObjectInternal + + { + /// Specifies if the additional information should be provided for this item. + string Expand { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GetProtectedItemQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GetProtectedItemQueryObject.json.cs new file mode 100644 index 000000000000..3d17a4377333 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/GetProtectedItemQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list backup items. + public partial class GetProtectedItemQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGetProtectedItemQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGetProtectedItemQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IGetProtectedItemQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new GetProtectedItemQueryObject(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal GetProtectedItemQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_expand = If( json?.PropertyT("expand"), out var __jsonExpand) ? (string)__jsonExpand : (string)Expand;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._expand)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._expand.ToString()) : null, "expand" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/HourlySchedule.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/HourlySchedule.cs new file mode 100644 index 000000000000..aeb538044dd1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/HourlySchedule.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class HourlySchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal + { + + /// Backing field for property. + private int? _interval; + + /// + /// Interval at which backup needs to be triggered. For hourly the value + /// can be 4/6/8/12 + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? Interval { get => this._interval; set => this._interval = value; } + + /// Backing field for property. + private int? _scheduleWindowDuration; + + /// To specify duration of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? ScheduleWindowDuration { get => this._scheduleWindowDuration; set => this._scheduleWindowDuration = value; } + + /// Backing field for property. + private global::System.DateTime? _scheduleWindowStartTime; + + /// To specify start time of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? ScheduleWindowStartTime { get => this._scheduleWindowStartTime; set => this._scheduleWindowStartTime = value; } + + /// Creates an new instance. + public HourlySchedule() + { + + } + } + public partial interface IHourlySchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// Interval at which backup needs to be triggered. For hourly the value + /// can be 4/6/8/12 + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Interval at which backup needs to be triggered. For hourly the value + can be 4/6/8/12", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? Interval { get; set; } + /// To specify duration of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To specify duration of the backup window", + SerializedName = @"scheduleWindowDuration", + PossibleTypes = new [] { typeof(int) })] + int? ScheduleWindowDuration { get; set; } + /// To specify start time of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To specify start time of the backup window", + SerializedName = @"scheduleWindowStartTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ScheduleWindowStartTime { get; set; } + + } + internal partial interface IHourlyScheduleInternal + + { + /// + /// Interval at which backup needs to be triggered. For hourly the value + /// can be 4/6/8/12 + /// + int? Interval { get; set; } + /// To specify duration of the backup window + int? ScheduleWindowDuration { get; set; } + /// To specify start time of the backup window + global::System.DateTime? ScheduleWindowStartTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/HourlySchedule.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/HourlySchedule.json.cs new file mode 100644 index 000000000000..7ff88e9516bc --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/HourlySchedule.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class HourlySchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new HourlySchedule(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal HourlySchedule(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_interval = If( json?.PropertyT("interval"), out var __jsonInterval) ? (int?)__jsonInterval : Interval;} + {_scheduleWindowStartTime = If( json?.PropertyT("scheduleWindowStartTime"), out var __jsonScheduleWindowStartTime) ? global::System.DateTime.TryParse((string)__jsonScheduleWindowStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonScheduleWindowStartTimeValue) ? __jsonScheduleWindowStartTimeValue : ScheduleWindowStartTime : ScheduleWindowStartTime;} + {_scheduleWindowDuration = If( json?.PropertyT("scheduleWindowDuration"), out var __jsonScheduleWindowDuration) ? (int?)__jsonScheduleWindowDuration : ScheduleWindowDuration;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._interval ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._interval) : null, "interval" ,container.Add ); + AddIf( null != this._scheduleWindowStartTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._scheduleWindowStartTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "scheduleWindowStartTime" ,container.Add ); + AddIf( null != this._scheduleWindowDuration ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._scheduleWindowDuration) : null, "scheduleWindowDuration" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmContainer.cs new file mode 100644 index 000000000000..a7b1372dde3f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmContainer.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific container. + public partial class IaaSvmContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType = value ; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus = value ?? null; } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType = value ?? null; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus = value ?? null; } + + /// Backing field for property. + private string _resourceGroup; + + /// Resource group name of Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceGroup { get => this._resourceGroup; set => this._resourceGroup = value; } + + /// Backing field for property. + private string _virtualMachineId; + + /// + /// Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VirtualMachineId { get => this._virtualMachineId; set => this._virtualMachineId = value; } + + /// Backing field for property. + private string _virtualMachineVersion; + + /// + /// Specifies whether the container represents a Classic or an Azure Resource Manager VM. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VirtualMachineVersion { get => this._virtualMachineVersion; set => this._virtualMachineVersion = value; } + + /// Creates an new instance. + public IaaSvmContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionContainer), __protectionContainer); + await eventListener.AssertObjectIsValid(nameof(__protectionContainer), __protectionContainer); + } + } + /// IaaS VM workload-specific container. + public partial interface IIaaSvmContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer + { + /// Resource group name of Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource group name of Recovery Services Vault.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; set; } + /// + /// Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container.", + SerializedName = @"virtualMachineId", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineId { get; set; } + /// + /// Specifies whether the container represents a Classic or an Azure Resource Manager VM. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether the container represents a Classic or an Azure Resource Manager VM.", + SerializedName = @"virtualMachineVersion", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineVersion { get; set; } + + } + /// IaaS VM workload-specific container. + internal partial interface IIaaSvmContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal + { + /// Resource group name of Recovery Services Vault. + string ResourceGroup { get; set; } + /// + /// Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + /// + string VirtualMachineId { get; set; } + /// + /// Specifies whether the container represents a Classic or an Azure Resource Manager VM. + /// + string VirtualMachineVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmContainer.json.cs new file mode 100644 index 000000000000..82288a6c7585 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific container. + public partial class IaaSvmContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainer. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainer interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("containerType") ) + { + case "Microsoft.ClassicCompute/virtualMachines": + { + return new AzureIaaSClassicComputeVmcontainer(json); + } + case "Microsoft.Compute/virtualMachines": + { + return new AzureIaaSComputeVmcontainer(json); + } + } + return new IaaSvmContainer(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IaaSvmContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(json); + {_virtualMachineId = If( json?.PropertyT("virtualMachineId"), out var __jsonVirtualMachineId) ? (string)__jsonVirtualMachineId : (string)VirtualMachineId;} + {_virtualMachineVersion = If( json?.PropertyT("virtualMachineVersion"), out var __jsonVirtualMachineVersion) ? (string)__jsonVirtualMachineVersion : (string)VirtualMachineVersion;} + {_resourceGroup = If( json?.PropertyT("resourceGroup"), out var __jsonResourceGroup) ? (string)__jsonResourceGroup : (string)ResourceGroup;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionContainer?.ToJson(container, serializationMode); + AddIf( null != (((object)this._virtualMachineId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._virtualMachineId.ToString()) : null, "virtualMachineId" ,container.Add ); + AddIf( null != (((object)this._virtualMachineVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._virtualMachineVersion.ToString()) : null, "virtualMachineVersion" ,container.Add ); + AddIf( null != (((object)this._resourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceGroup.ToString()) : null, "resourceGroup" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmProtectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmProtectableItem.cs new file mode 100644 index 000000000000..7a178d09fd4b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmProtectableItem.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup item. + public partial class IaaSvmProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem __workloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItem(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).BackupManagementType = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).FriendlyName = value ?? null; } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectableItemType = value ; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Backing field for property. + private string _resourceGroup; + + /// Resource group name of Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceGroup { get => this._resourceGroup; set => this._resourceGroup = value; } + + /// Backing field for property. + private string _virtualMachineId; + + /// Fully qualified ARM ID of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VirtualMachineId { get => this._virtualMachineId; set => this._virtualMachineId = value; } + + /// Backing field for property. + private string _virtualMachineVersion; + + /// + /// Specifies whether the container represents a Classic or an Azure Resource Manager VM. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VirtualMachineVersion { get => this._virtualMachineVersion; set => this._virtualMachineVersion = value; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)__workloadProtectableItem).WorkloadType = value ?? null; } + + /// Creates an new instance. + public IaaSvmProtectableItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__workloadProtectableItem), __workloadProtectableItem); + await eventListener.AssertObjectIsValid(nameof(__workloadProtectableItem), __workloadProtectableItem); + } + } + /// IaaS VM workload-specific backup item. + public partial interface IIaaSvmProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem + { + /// Resource group name of Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource group name of Recovery Services Vault.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; set; } + /// Fully qualified ARM ID of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM ID of the virtual machine.", + SerializedName = @"virtualMachineId", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineId { get; set; } + /// + /// Specifies whether the container represents a Classic or an Azure Resource Manager VM. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether the container represents a Classic or an Azure Resource Manager VM.", + SerializedName = @"virtualMachineVersion", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineVersion { get; set; } + + } + /// IaaS VM workload-specific backup item. + internal partial interface IIaaSvmProtectableItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal + { + /// Resource group name of Recovery Services Vault. + string ResourceGroup { get; set; } + /// Fully qualified ARM ID of the virtual machine. + string VirtualMachineId { get; set; } + /// + /// Specifies whether the container represents a Classic or an Azure Resource Manager VM. + /// + string VirtualMachineVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmProtectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmProtectableItem.json.cs new file mode 100644 index 000000000000..cfa9b8728471 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaaSvmProtectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup item. + public partial class IaaSvmProtectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItem interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaaSvmProtectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("protectableItemType") ) + { + case "Microsoft.ClassicCompute/virtualMachines": + { + return new AzureIaaSClassicComputeVmprotectableItem(json); + } + case "Microsoft.Compute/virtualMachines": + { + return new AzureIaaSComputeVmprotectableItem(json); + } + } + return new IaaSvmProtectableItem(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IaaSvmProtectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __workloadProtectableItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItem(json); + {_virtualMachineId = If( json?.PropertyT("virtualMachineId"), out var __jsonVirtualMachineId) ? (string)__jsonVirtualMachineId : (string)VirtualMachineId;} + {_virtualMachineVersion = If( json?.PropertyT("virtualMachineVersion"), out var __jsonVirtualMachineVersion) ? (string)__jsonVirtualMachineVersion : (string)VirtualMachineVersion;} + {_resourceGroup = If( json?.PropertyT("resourceGroup"), out var __jsonResourceGroup) ? (string)__jsonResourceGroup : (string)ResourceGroup;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __workloadProtectableItem?.ToJson(container, serializationMode); + AddIf( null != (((object)this._virtualMachineId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._virtualMachineId.ToString()) : null, "virtualMachineId" ,container.Add ); + AddIf( null != (((object)this._virtualMachineVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._virtualMachineVersion.ToString()) : null, "virtualMachineVersion" ,container.Add ); + AddIf( null != (((object)this._resourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceGroup.ToString()) : null, "resourceGroup" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMBackupRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMBackupRequest.cs new file mode 100644 index 000000000000..825ac67db260 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMBackupRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup request. + public partial class IaasVMBackupRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMBackupRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMBackupRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest __backupRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupRequest(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal)__backupRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal)__backupRequest).ObjectType = value ; } + + /// Backing field for property. + private global::System.DateTime? _recoveryPointExpiryTimeInUtc; + + /// Backup copy will expire after the time specified (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? RecoveryPointExpiryTimeInUtc { get => this._recoveryPointExpiryTimeInUtc; set => this._recoveryPointExpiryTimeInUtc = value; } + + /// Creates an new instance. + public IaasVMBackupRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__backupRequest), __backupRequest); + await eventListener.AssertObjectIsValid(nameof(__backupRequest), __backupRequest); + } + } + /// IaaS VM workload-specific backup request. + public partial interface IIaasVMBackupRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequest + { + /// Backup copy will expire after the time specified (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup copy will expire after the time specified (UTC).", + SerializedName = @"recoveryPointExpiryTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecoveryPointExpiryTimeInUtc { get; set; } + + } + /// IaaS VM workload-specific backup request. + internal partial interface IIaasVMBackupRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestInternal + { + /// Backup copy will expire after the time specified (UTC). + global::System.DateTime? RecoveryPointExpiryTimeInUtc { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMBackupRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMBackupRequest.json.cs new file mode 100644 index 000000000000..4a8d4f2d1751 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMBackupRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific backup request. + public partial class IaasVMBackupRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMBackupRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMBackupRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMBackupRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new IaasVMBackupRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IaasVMBackupRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __backupRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupRequest(json); + {_recoveryPointExpiryTimeInUtc = If( json?.PropertyT("recoveryPointExpiryTimeInUTC"), out var __jsonRecoveryPointExpiryTimeInUtc) ? global::System.DateTime.TryParse((string)__jsonRecoveryPointExpiryTimeInUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRecoveryPointExpiryTimeInUtcValue) ? __jsonRecoveryPointExpiryTimeInUtcValue : RecoveryPointExpiryTimeInUtc : RecoveryPointExpiryTimeInUtc;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __backupRequest?.ToJson(container, serializationMode); + AddIf( null != this._recoveryPointExpiryTimeInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointExpiryTimeInUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "recoveryPointExpiryTimeInUTC" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPoint.cs new file mode 100644 index 000000000000..7514f8db2a4e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPoint.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload specific backup copy. + public partial class IaasVMRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint(); + + /// BEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BekDetailSecretData { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetailSecretData; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetailSecretData = value ?? null; } + + /// Secret is BEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BekDetailSecretUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetailSecretUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetailSecretUrl = value ?? null; } + + /// ID of the Key Vault where this Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BekDetailSecretVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetailSecretVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetailSecretVaultId = value ?? null; } + + /// Backing field for property. + private bool? _isInstantIlrSessionActive; + + /// Is the session to recover items from this backup copy still active. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsInstantIlrSessionActive { get => this._isInstantIlrSessionActive; set => this._isInstantIlrSessionActive = value; } + + /// Backing field for property. + private bool? _isManagedVirtualMachine; + + /// Whether VM is with Managed Disks + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsManagedVirtualMachine { get => this._isManagedVirtualMachine; set => this._isManagedVirtualMachine = value; } + + /// Backing field for property. + private bool? _isSourceVMEncrypted; + + /// Identifies whether the VM was encrypted when the backup copy is created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsSourceVMEncrypted { get => this._isSourceVMEncrypted; set => this._isSourceVMEncrypted = value; } + + /// KEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string KekDetailKeyBackupData { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetailKeyBackupData; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetailKeyBackupData = value ?? null; } + + /// Key is KEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string KekDetailKeyUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetailKeyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetailKeyUrl = value ?? null; } + + /// Key Vault ID where this Key is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string KekDetailKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetailKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetailKeyVaultId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetails _keyAndSecret; + + /// + /// Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetails KeyAndSecret { get => (this._keyAndSecret = this._keyAndSecret ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.KeyAndSecretDetails()); set => this._keyAndSecret = value; } + + /// Encryption mechanism: None/ SinglePass/ DoublePass + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string KeyAndSecretEncryptionMechanism { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).EncryptionMechanism; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).EncryptionMechanism = value ?? null; } + + /// Internal Acessors for KeyAndSecret + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointInternal.KeyAndSecret { get => (this._keyAndSecret = this._keyAndSecret ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.KeyAndSecretDetails()); set { {_keyAndSecret = value;} } } + + /// Internal Acessors for KeyAndSecretBekDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointInternal.KeyAndSecretBekDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetail = value; } + + /// Internal Acessors for KeyAndSecretKekDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointInternal.KeyAndSecretKekDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetail = value; } + + /// Internal Acessors for RecoveryPointDiskConfiguration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfiguration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointInternal.RecoveryPointDiskConfiguration { get => (this._recoveryPointDiskConfiguration = this._recoveryPointDiskConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointDiskConfiguration()); set { {_recoveryPointDiskConfiguration = value;} } } + + /// Backing field for property. + private string _oSType; + + /// OS type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string OSType { get => this._oSType; set => this._oSType = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__recoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)__recoveryPoint).ObjectType = value ; } + + /// Backing field for property. + private bool? _originalStorageAccountOption; + + /// Original Storage Account Option + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? OriginalStorageAccountOption { get => this._originalStorageAccountOption; set => this._originalStorageAccountOption = value; } + + /// Backing field for property. + private string _recoveryPointAdditionalInfo; + + /// Additional information associated with this backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryPointAdditionalInfo { get => this._recoveryPointAdditionalInfo; set => this._recoveryPointAdditionalInfo = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfiguration _recoveryPointDiskConfiguration; + + /// Disk configuration + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfiguration RecoveryPointDiskConfiguration { get => (this._recoveryPointDiskConfiguration = this._recoveryPointDiskConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointDiskConfiguration()); set => this._recoveryPointDiskConfiguration = value; } + + /// Information of disks excluded from backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] RecoveryPointDiskConfigurationExcludedDiskList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).ExcludedDiskList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).ExcludedDiskList = value ?? null /* arrayOf */; } + + /// Information of disks included in backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] RecoveryPointDiskConfigurationIncludedDiskList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).IncludedDiskList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).IncludedDiskList = value ?? null /* arrayOf */; } + + /// Number of disks attached to the VM + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).NumberOfDisksAttachedToVM; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).NumberOfDisksAttachedToVM = value ?? default(int); } + + /// Number of disks included in backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).NumberOfDisksIncludedInBackup; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).NumberOfDisksIncludedInBackup = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointMoveReadinessInfo _recoveryPointMoveReadinessInfo; + + /// Eligibility of RP to be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => (this._recoveryPointMoveReadinessInfo = this._recoveryPointMoveReadinessInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaasVMRecoveryPointMoveReadinessInfo()); set => this._recoveryPointMoveReadinessInfo = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] _recoveryPointTierDetail; + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get => this._recoveryPointTierDetail; set => this._recoveryPointTierDetail = value; } + + /// Backing field for property. + private global::System.DateTime? _recoveryPointTime; + + /// Time at which this backup copy was created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? RecoveryPointTime { get => this._recoveryPointTime; set => this._recoveryPointTime = value; } + + /// Backing field for property. + private string _recoveryPointType; + + /// Type of the backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryPointType { get => this._recoveryPointType; set => this._recoveryPointType = value; } + + /// Backing field for property. + private string _sourceVMStorageType; + + /// Storage type of the VM whose backup copy is created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceVMStorageType { get => this._sourceVMStorageType; set => this._sourceVMStorageType = value; } + + /// Backing field for property. + private string _virtualMachineSize; + + /// Virtual Machine Size + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VirtualMachineSize { get => this._virtualMachineSize; set => this._virtualMachineSize = value; } + + /// Backing field for property. + private string[] _zone; + + /// + /// Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Zone { get => this._zone; set => this._zone = value; } + + /// Creates an new instance. + public IaasVMRecoveryPoint() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__recoveryPoint), __recoveryPoint); + await eventListener.AssertObjectIsValid(nameof(__recoveryPoint), __recoveryPoint); + } + } + /// IaaS VM workload specific backup copy. + public partial interface IIaasVMRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint + { + /// BEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"BEK data.", + SerializedName = @"secretData", + PossibleTypes = new [] { typeof(string) })] + string BekDetailSecretData { get; set; } + /// Secret is BEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secret is BEK.", + SerializedName = @"secretUrl", + PossibleTypes = new [] { typeof(string) })] + string BekDetailSecretUrl { get; set; } + /// ID of the Key Vault where this Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the Key Vault where this Secret is stored.", + SerializedName = @"secretVaultId", + PossibleTypes = new [] { typeof(string) })] + string BekDetailSecretVaultId { get; set; } + /// Is the session to recover items from this backup copy still active. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Is the session to recover items from this backup copy still active.", + SerializedName = @"isInstantIlrSessionActive", + PossibleTypes = new [] { typeof(bool) })] + bool? IsInstantIlrSessionActive { get; set; } + /// Whether VM is with Managed Disks + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether VM is with Managed Disks", + SerializedName = @"isManagedVirtualMachine", + PossibleTypes = new [] { typeof(bool) })] + bool? IsManagedVirtualMachine { get; set; } + /// Identifies whether the VM was encrypted when the backup copy is created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies whether the VM was encrypted when the backup copy is created.", + SerializedName = @"isSourceVMEncrypted", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSourceVMEncrypted { get; set; } + /// KEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"KEK data.", + SerializedName = @"keyBackupData", + PossibleTypes = new [] { typeof(string) })] + string KekDetailKeyBackupData { get; set; } + /// Key is KEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key is KEK.", + SerializedName = @"keyUrl", + PossibleTypes = new [] { typeof(string) })] + string KekDetailKeyUrl { get; set; } + /// Key Vault ID where this Key is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Vault ID where this Key is stored.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string KekDetailKeyVaultId { get; set; } + /// Encryption mechanism: None/ SinglePass/ DoublePass + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption mechanism: None/ SinglePass/ DoublePass", + SerializedName = @"encryptionMechanism", + PossibleTypes = new [] { typeof(string) })] + string KeyAndSecretEncryptionMechanism { get; set; } + /// OS type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OS type", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(string) })] + string OSType { get; set; } + /// Original Storage Account Option + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Original Storage Account Option", + SerializedName = @"originalStorageAccountOption", + PossibleTypes = new [] { typeof(bool) })] + bool? OriginalStorageAccountOption { get; set; } + /// Additional information associated with this backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional information associated with this backup copy.", + SerializedName = @"recoveryPointAdditionalInfo", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointAdditionalInfo { get; set; } + /// Information of disks excluded from backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information of disks excluded from backup", + SerializedName = @"excludedDiskList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] RecoveryPointDiskConfigurationExcludedDiskList { get; set; } + /// Information of disks included in backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information of disks included in backup", + SerializedName = @"includedDiskList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] RecoveryPointDiskConfigurationIncludedDiskList { get; set; } + /// Number of disks attached to the VM + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of disks attached to the VM", + SerializedName = @"numberOfDisksAttachedToVm", + PossibleTypes = new [] { typeof(int) })] + int? RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM { get; set; } + /// Number of disks included in backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of disks included in backup", + SerializedName = @"numberOfDisksIncludedInBackup", + PossibleTypes = new [] { typeof(int) })] + int? RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup { get; set; } + /// Eligibility of RP to be moved to another tier + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Eligibility of RP to be moved to another tier", + SerializedName = @"recoveryPointMoveReadinessInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointMoveReadinessInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get; set; } + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point tier information.", + SerializedName = @"recoveryPointTierDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get; set; } + /// Time at which this backup copy was created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time at which this backup copy was created.", + SerializedName = @"recoveryPointTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecoveryPointTime { get; set; } + /// Type of the backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the backup copy.", + SerializedName = @"recoveryPointType", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointType { get; set; } + /// Storage type of the VM whose backup copy is created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage type of the VM whose backup copy is created.", + SerializedName = @"sourceVMStorageType", + PossibleTypes = new [] { typeof(string) })] + string SourceVMStorageType { get; set; } + /// Virtual Machine Size + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Virtual Machine Size", + SerializedName = @"virtualMachineSize", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineSize { get; set; } + /// + /// Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms", + SerializedName = @"zones", + PossibleTypes = new [] { typeof(string) })] + string[] Zone { get; set; } + + } + /// IaaS VM workload specific backup copy. + internal partial interface IIaasVMRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal + { + /// BEK data. + string BekDetailSecretData { get; set; } + /// Secret is BEK. + string BekDetailSecretUrl { get; set; } + /// ID of the Key Vault where this Secret is stored. + string BekDetailSecretVaultId { get; set; } + /// Is the session to recover items from this backup copy still active. + bool? IsInstantIlrSessionActive { get; set; } + /// Whether VM is with Managed Disks + bool? IsManagedVirtualMachine { get; set; } + /// Identifies whether the VM was encrypted when the backup copy is created. + bool? IsSourceVMEncrypted { get; set; } + /// KEK data. + string KekDetailKeyBackupData { get; set; } + /// Key is KEK. + string KekDetailKeyUrl { get; set; } + /// Key Vault ID where this Key is stored. + string KekDetailKeyVaultId { get; set; } + /// + /// Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetails KeyAndSecret { get; set; } + /// BEK is bitlocker encryption key. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetails KeyAndSecretBekDetail { get; set; } + /// Encryption mechanism: None/ SinglePass/ DoublePass + string KeyAndSecretEncryptionMechanism { get; set; } + /// KEK is encryption key for BEK. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetails KeyAndSecretKekDetail { get; set; } + /// OS type + string OSType { get; set; } + /// Original Storage Account Option + bool? OriginalStorageAccountOption { get; set; } + /// Additional information associated with this backup copy. + string RecoveryPointAdditionalInfo { get; set; } + /// Disk configuration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfiguration RecoveryPointDiskConfiguration { get; set; } + /// Information of disks excluded from backup + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] RecoveryPointDiskConfigurationExcludedDiskList { get; set; } + /// Information of disks included in backup + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] RecoveryPointDiskConfigurationIncludedDiskList { get; set; } + /// Number of disks attached to the VM + int? RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM { get; set; } + /// Number of disks included in backup + int? RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup { get; set; } + /// Eligibility of RP to be moved to another tier + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get; set; } + /// Recovery point tier information. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2[] RecoveryPointTierDetail { get; set; } + /// Time at which this backup copy was created. + global::System.DateTime? RecoveryPointTime { get; set; } + /// Type of the backup copy. + string RecoveryPointType { get; set; } + /// Storage type of the VM whose backup copy is created. + string SourceVMStorageType { get; set; } + /// Virtual Machine Size + string VirtualMachineSize { get; set; } + /// + /// Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms + /// + string[] Zone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPoint.json.cs new file mode 100644 index 000000000000..30e31abfa286 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPoint.json.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload specific backup copy. + public partial class IaasVMRecoveryPoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new IaasVMRecoveryPoint(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IaasVMRecoveryPoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint(json); + {_keyAndSecret = If( json?.PropertyT("keyAndSecret"), out var __jsonKeyAndSecret) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.KeyAndSecretDetails.FromJson(__jsonKeyAndSecret) : KeyAndSecret;} + {_recoveryPointDiskConfiguration = If( json?.PropertyT("recoveryPointDiskConfiguration"), out var __jsonRecoveryPointDiskConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointDiskConfiguration.FromJson(__jsonRecoveryPointDiskConfiguration) : RecoveryPointDiskConfiguration;} + {_recoveryPointType = If( json?.PropertyT("recoveryPointType"), out var __jsonRecoveryPointType) ? (string)__jsonRecoveryPointType : (string)RecoveryPointType;} + {_recoveryPointTime = If( json?.PropertyT("recoveryPointTime"), out var __jsonRecoveryPointTime) ? global::System.DateTime.TryParse((string)__jsonRecoveryPointTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRecoveryPointTimeValue) ? __jsonRecoveryPointTimeValue : RecoveryPointTime : RecoveryPointTime;} + {_recoveryPointAdditionalInfo = If( json?.PropertyT("recoveryPointAdditionalInfo"), out var __jsonRecoveryPointAdditionalInfo) ? (string)__jsonRecoveryPointAdditionalInfo : (string)RecoveryPointAdditionalInfo;} + {_sourceVMStorageType = If( json?.PropertyT("sourceVMStorageType"), out var __jsonSourceVMStorageType) ? (string)__jsonSourceVMStorageType : (string)SourceVMStorageType;} + {_isSourceVMEncrypted = If( json?.PropertyT("isSourceVMEncrypted"), out var __jsonIsSourceVMEncrypted) ? (bool?)__jsonIsSourceVMEncrypted : IsSourceVMEncrypted;} + {_isInstantIlrSessionActive = If( json?.PropertyT("isInstantIlrSessionActive"), out var __jsonIsInstantIlrSessionActive) ? (bool?)__jsonIsInstantIlrSessionActive : IsInstantIlrSessionActive;} + {_recoveryPointTierDetail = If( json?.PropertyT("recoveryPointTierDetails"), out var __jsonRecoveryPointTierDetails) ? If( __jsonRecoveryPointTierDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointTierInformationV2.FromJson(__u) )) ))() : null : RecoveryPointTierDetail;} + {_isManagedVirtualMachine = If( json?.PropertyT("isManagedVirtualMachine"), out var __jsonIsManagedVirtualMachine) ? (bool?)__jsonIsManagedVirtualMachine : IsManagedVirtualMachine;} + {_virtualMachineSize = If( json?.PropertyT("virtualMachineSize"), out var __jsonVirtualMachineSize) ? (string)__jsonVirtualMachineSize : (string)VirtualMachineSize;} + {_originalStorageAccountOption = If( json?.PropertyT("originalStorageAccountOption"), out var __jsonOriginalStorageAccountOption) ? (bool?)__jsonOriginalStorageAccountOption : OriginalStorageAccountOption;} + {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)OSType;} + {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : Zone;} + {_recoveryPointMoveReadinessInfo = If( json?.PropertyT("recoveryPointMoveReadinessInfo"), out var __jsonRecoveryPointMoveReadinessInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaasVMRecoveryPointMoveReadinessInfo.FromJson(__jsonRecoveryPointMoveReadinessInfo) : RecoveryPointMoveReadinessInfo;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __recoveryPoint?.ToJson(container, serializationMode); + AddIf( null != this._keyAndSecret ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._keyAndSecret.ToJson(null,serializationMode) : null, "keyAndSecret" ,container.Add ); + AddIf( null != this._recoveryPointDiskConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointDiskConfiguration.ToJson(null,serializationMode) : null, "recoveryPointDiskConfiguration" ,container.Add ); + AddIf( null != (((object)this._recoveryPointType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointType.ToString()) : null, "recoveryPointType" ,container.Add ); + AddIf( null != this._recoveryPointTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "recoveryPointTime" ,container.Add ); + AddIf( null != (((object)this._recoveryPointAdditionalInfo)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointAdditionalInfo.ToString()) : null, "recoveryPointAdditionalInfo" ,container.Add ); + AddIf( null != (((object)this._sourceVMStorageType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceVMStorageType.ToString()) : null, "sourceVMStorageType" ,container.Add ); + AddIf( null != this._isSourceVMEncrypted ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isSourceVMEncrypted) : null, "isSourceVMEncrypted" ,container.Add ); + AddIf( null != this._isInstantIlrSessionActive ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isInstantIlrSessionActive) : null, "isInstantIlrSessionActive" ,container.Add ); + if (null != this._recoveryPointTierDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recoveryPointTierDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("recoveryPointTierDetails",__w); + } + AddIf( null != this._isManagedVirtualMachine ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isManagedVirtualMachine) : null, "isManagedVirtualMachine" ,container.Add ); + AddIf( null != (((object)this._virtualMachineSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._virtualMachineSize.ToString()) : null, "virtualMachineSize" ,container.Add ); + AddIf( null != this._originalStorageAccountOption ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._originalStorageAccountOption) : null, "originalStorageAccountOption" ,container.Add ); + AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oSType.ToString()) : null, "osType" ,container.Add ); + if (null != this._zone) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._zone ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("zones",__r); + } + AddIf( null != this._recoveryPointMoveReadinessInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointMoveReadinessInfo.ToJson(null,serializationMode) : null, "recoveryPointMoveReadinessInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.cs new file mode 100644 index 000000000000..501c192ea083 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Eligibility of RP to be moved to another tier + public partial class IaasVMRecoveryPointMoveReadinessInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointMoveReadinessInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointMoveReadinessInfoInternal + { + + /// Creates an new instance. + public IaasVMRecoveryPointMoveReadinessInfo() + { + + } + } + /// Eligibility of RP to be moved to another tier + public partial interface IIaasVMRecoveryPointMoveReadinessInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Eligibility of RP to be moved to another tier + internal partial interface IIaasVMRecoveryPointMoveReadinessInfoInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.dictionary.cs new file mode 100644 index 000000000000..ea4f9ee60fa3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class IaasVMRecoveryPointMoveReadinessInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfo this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfo value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfo value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaasVMRecoveryPointMoveReadinessInfo source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.json.cs new file mode 100644 index 000000000000..391d4a7c0fef --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRecoveryPointMoveReadinessInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Eligibility of RP to be moved to another tier + public partial class IaasVMRecoveryPointMoveReadinessInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointMoveReadinessInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointMoveReadinessInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRecoveryPointMoveReadinessInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new IaasVMRecoveryPointMoveReadinessInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal IaasVMRecoveryPointMoveReadinessInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointMoveReadinessInfo.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreRequest.cs new file mode 100644 index 000000000000..5b4027bf318b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreRequest.cs @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific restore. + public partial class IaasVMRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest __restoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest(); + + /// Backing field for property. + private string _affinityGroup; + + /// + /// Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AffinityGroup { get => this._affinityGroup; set => this._affinityGroup = value; } + + /// Backing field for property. + private bool? _createNewCloudService; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? CreateNewCloudService { get => this._createNewCloudService; set => this._createNewCloudService = value; } + + /// Backing field for property. + private string _diskEncryptionSetId; + + /// + /// DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest during restore with customer managed key. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DiskEncryptionSetId { get => this._diskEncryptionSetId; set => this._diskEncryptionSetId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetails _encryptionDetail; + + /// Details needed if the VM was encrypted at the time of backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetails EncryptionDetail { get => (this._encryptionDetail = this._encryptionDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.EncryptionDetails()); set => this._encryptionDetail = value; } + + /// + /// Identifies whether this backup copy represents an encrypted VM at the time of backup. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? EncryptionDetailEncryptionEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal)EncryptionDetail).EncryptionEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal)EncryptionDetail).EncryptionEnabled = value ?? default(bool); } + + /// Key Url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string EncryptionDetailKekUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal)EncryptionDetail).KekUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal)EncryptionDetail).KekUrl = value ?? null; } + + /// ID of Key Vault where KEK is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string EncryptionDetailKekVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal)EncryptionDetail).KekVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal)EncryptionDetail).KekVaultId = value ?? null; } + + /// Secret Url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string EncryptionDetailSecretKeyUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal)EncryptionDetail).SecretKeyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal)EncryptionDetail).SecretKeyUrl = value ?? null; } + + /// ID of Key Vault where Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string EncryptionDetailSecretKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal)EncryptionDetail).SecretKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetailsInternal)EncryptionDetail).SecretKeyVaultId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetails _identityBasedRestoreDetail; + + /// IaaS VM workload specific restore details for restores using managed identity. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetails IdentityBasedRestoreDetail { get => (this._identityBasedRestoreDetail = this._identityBasedRestoreDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IdentityBasedRestoreDetails()); set => this._identityBasedRestoreDetail = value; } + + /// Gets the class type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string IdentityBasedRestoreDetailObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetailsInternal)IdentityBasedRestoreDetail).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetailsInternal)IdentityBasedRestoreDetail).ObjectType = value ?? null; } + + /// Fully qualified ARM ID of the target storage account. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string IdentityBasedRestoreDetailTargetStorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetailsInternal)IdentityBasedRestoreDetail).TargetStorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetailsInternal)IdentityBasedRestoreDetail).TargetStorageAccountId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfo _identityInfo; + + /// Managed Identity information required to access customer storage account. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfo IdentityInfo { get => (this._identityInfo = this._identityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IdentityInfo()); set => this._identityInfo = value; } + + /// To differentiate if the managed identity is system assigned or user assigned + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? IdentityInfoIsSystemAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfoInternal)IdentityInfo).IsSystemAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfoInternal)IdentityInfo).IsSystemAssignedIdentity = value ?? default(bool); } + + /// + /// Managed Identity Resource Id + /// Optional: Might not be required in the case of system assigned managed identity + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string IdentityInfoManagedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfoInternal)IdentityInfo).ManagedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfoInternal)IdentityInfo).ManagedIdentityResourceId = value ?? null; } + + /// Internal Acessors for EncryptionDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal.EncryptionDetail { get => (this._encryptionDetail = this._encryptionDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.EncryptionDetails()); set { {_encryptionDetail = value;} } } + + /// Internal Acessors for IdentityBasedRestoreDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal.IdentityBasedRestoreDetail { get => (this._identityBasedRestoreDetail = this._identityBasedRestoreDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IdentityBasedRestoreDetails()); set { {_identityBasedRestoreDetail = value;} } } + + /// Internal Acessors for IdentityInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal.IdentityInfo { get => (this._identityInfo = this._identityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IdentityInfo()); set { {_identityInfo = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__restoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__restoreRequest).ObjectType = value ; } + + /// Backing field for property. + private bool? _originalStorageAccountOption; + + /// Original Storage Account Option + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? OriginalStorageAccountOption { get => this._originalStorageAccountOption; set => this._originalStorageAccountOption = value; } + + /// Backing field for property. + private string _recoveryPointId; + + /// ID of the backup copy to be recovered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryPointId { get => this._recoveryPointId; set => this._recoveryPointId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? _recoveryType; + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => this._recoveryType; set => this._recoveryType = value; } + + /// Backing field for property. + private string _region; + + /// Region in which the virtual machine is restored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Region { get => this._region; set => this._region = value; } + + /// Backing field for property. + private int[] _restoreDiskLunList; + + /// List of Disk LUNs for partial restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int[] RestoreDiskLunList { get => this._restoreDiskLunList; set => this._restoreDiskLunList = value; } + + /// Backing field for property. + private bool? _restoreWithManagedDisk; + + /// Flag to denote of an Unmanaged disk VM should be restored with Managed disks. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? RestoreWithManagedDisk { get => this._restoreWithManagedDisk; set => this._restoreWithManagedDisk = value; } + + /// Backing field for property. + private string _sourceResourceId; + + /// Fully qualified ARM ID of the VM which is being recovered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Backing field for property. + private string _storageAccountId; + + /// + /// Fully qualified ARM ID of the storage account to which the VM has to be restored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string StorageAccountId { get => this._storageAccountId; set => this._storageAccountId = value; } + + /// Backing field for property. + private string _subnetId; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SubnetId { get => this._subnetId; set => this._subnetId = value; } + + /// Backing field for property. + private string _targetDomainNameId; + + /// + /// Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + /// Virtual Machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetDomainNameId { get => this._targetDomainNameId; set => this._targetDomainNameId = value; } + + /// Backing field for property. + private string _targetResourceGroupId; + + /// + /// 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} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetResourceGroupId { get => this._targetResourceGroupId; set => this._targetResourceGroupId = value; } + + /// Backing field for property. + private string _targetVirtualMachineId; + + /// + /// 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} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetVirtualMachineId { get => this._targetVirtualMachineId; set => this._targetVirtualMachineId = value; } + + /// Backing field for property. + private string _virtualNetworkId; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VirtualNetworkId { get => this._virtualNetworkId; set => this._virtualNetworkId = value; } + + /// Backing field for property. + private string[] _zone; + + /// Target zone where the VM and its disks should be restored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Zone { get => this._zone; set => this._zone = value; } + + /// Creates an new instance. + public IaasVMRestoreRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__restoreRequest), __restoreRequest); + await eventListener.AssertObjectIsValid(nameof(__restoreRequest), __restoreRequest); + } + } + /// IaaS VM workload-specific restore. + public partial interface IIaasVMRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest + { + /// + /// Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines.", + SerializedName = @"affinityGroup", + PossibleTypes = new [] { typeof(string) })] + string AffinityGroup { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"createNewCloudService", + PossibleTypes = new [] { typeof(bool) })] + bool? CreateNewCloudService { get; set; } + /// + /// DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest during restore with customer managed key. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest during restore with customer managed key.", + SerializedName = @"diskEncryptionSetId", + PossibleTypes = new [] { typeof(string) })] + string DiskEncryptionSetId { get; set; } + /// + /// Identifies whether this backup copy represents an encrypted VM at the time of backup. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies whether this backup copy represents an encrypted VM at the time of backup.", + SerializedName = @"encryptionEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? EncryptionDetailEncryptionEnabled { get; set; } + /// Key Url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Url.", + SerializedName = @"kekUrl", + PossibleTypes = new [] { typeof(string) })] + string EncryptionDetailKekUrl { get; set; } + /// ID of Key Vault where KEK is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of Key Vault where KEK is stored.", + SerializedName = @"kekVaultId", + PossibleTypes = new [] { typeof(string) })] + string EncryptionDetailKekVaultId { get; set; } + /// Secret Url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secret Url.", + SerializedName = @"secretKeyUrl", + PossibleTypes = new [] { typeof(string) })] + string EncryptionDetailSecretKeyUrl { get; set; } + /// ID of Key Vault where Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of Key Vault where Secret is stored.", + SerializedName = @"secretKeyVaultId", + PossibleTypes = new [] { typeof(string) })] + string EncryptionDetailSecretKeyVaultId { get; set; } + /// Gets the class type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets the class type.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string IdentityBasedRestoreDetailObjectType { get; set; } + /// Fully qualified ARM ID of the target storage account. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM ID of the target storage account.", + SerializedName = @"targetStorageAccountId", + PossibleTypes = new [] { typeof(string) })] + string IdentityBasedRestoreDetailTargetStorageAccountId { get; set; } + /// To differentiate if the managed identity is system assigned or user assigned + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To differentiate if the managed identity is system assigned or user assigned", + SerializedName = @"isSystemAssignedIdentity", + PossibleTypes = new [] { typeof(bool) })] + bool? IdentityInfoIsSystemAssignedIdentity { get; set; } + /// + /// Managed Identity Resource Id + /// Optional: Might not be required in the case of system assigned managed identity + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Managed Identity Resource Id + Optional: Might not be required in the case of system assigned managed identity", + SerializedName = @"managedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string IdentityInfoManagedIdentityResourceId { get; set; } + /// Original Storage Account Option + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Original Storage Account Option", + SerializedName = @"originalStorageAccountOption", + PossibleTypes = new [] { typeof(bool) })] + bool? OriginalStorageAccountOption { get; set; } + /// ID of the backup copy to be recovered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the backup copy to be recovered.", + SerializedName = @"recoveryPointId", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointId { get; set; } + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of this recovery.", + SerializedName = @"recoveryType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get; set; } + /// Region in which the virtual machine is restored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Region in which the virtual machine is restored.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string Region { get; set; } + /// List of Disk LUNs for partial restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Disk LUNs for partial restore", + SerializedName = @"restoreDiskLunList", + PossibleTypes = new [] { typeof(int) })] + int[] RestoreDiskLunList { get; set; } + /// Flag to denote of an Unmanaged disk VM should be restored with Managed disks. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to denote of an Unmanaged disk VM should be restored with Managed disks.", + SerializedName = @"restoreWithManagedDisks", + PossibleTypes = new [] { typeof(bool) })] + bool? RestoreWithManagedDisk { get; set; } + /// Fully qualified ARM ID of the VM which is being recovered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM ID of the VM which is being recovered.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + /// + /// Fully qualified ARM ID of the storage account to which the VM has to be restored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM ID of the storage account to which the VM has to be restored.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"subnetId", + PossibleTypes = new [] { typeof(string) })] + string SubnetId { get; set; } + /// + /// Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + /// Virtual Machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + Virtual Machines.", + SerializedName = @"targetDomainNameId", + PossibleTypes = new [] { typeof(string) })] + string TargetDomainNameId { get; set; } + /// + /// 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} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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}", + SerializedName = @"targetResourceGroupId", + PossibleTypes = new [] { typeof(string) })] + string TargetResourceGroupId { get; set; } + /// + /// 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} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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}", + SerializedName = @"targetVirtualMachineId", + PossibleTypes = new [] { typeof(string) })] + string TargetVirtualMachineId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"virtualNetworkId", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkId { get; set; } + /// Target zone where the VM and its disks should be restored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target zone where the VM and its disks should be restored.", + SerializedName = @"zones", + PossibleTypes = new [] { typeof(string) })] + string[] Zone { get; set; } + + } + /// IaaS VM workload-specific restore. + internal partial interface IIaasVMRestoreRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal + { + /// + /// Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + /// + string AffinityGroup { get; set; } + /// + /// 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. + /// + bool? CreateNewCloudService { get; set; } + /// + /// DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest during restore with customer managed key. + /// + string DiskEncryptionSetId { get; set; } + /// Details needed if the VM was encrypted at the time of backup. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetails EncryptionDetail { get; set; } + /// + /// Identifies whether this backup copy represents an encrypted VM at the time of backup. + /// + bool? EncryptionDetailEncryptionEnabled { get; set; } + /// Key Url. + string EncryptionDetailKekUrl { get; set; } + /// ID of Key Vault where KEK is stored. + string EncryptionDetailKekVaultId { get; set; } + /// Secret Url. + string EncryptionDetailSecretKeyUrl { get; set; } + /// ID of Key Vault where Secret is stored. + string EncryptionDetailSecretKeyVaultId { get; set; } + /// IaaS VM workload specific restore details for restores using managed identity. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetails IdentityBasedRestoreDetail { get; set; } + /// Gets the class type. + string IdentityBasedRestoreDetailObjectType { get; set; } + /// Fully qualified ARM ID of the target storage account. + string IdentityBasedRestoreDetailTargetStorageAccountId { get; set; } + /// Managed Identity information required to access customer storage account. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfo IdentityInfo { get; set; } + /// To differentiate if the managed identity is system assigned or user assigned + bool? IdentityInfoIsSystemAssignedIdentity { get; set; } + /// + /// Managed Identity Resource Id + /// Optional: Might not be required in the case of system assigned managed identity + /// + string IdentityInfoManagedIdentityResourceId { get; set; } + /// Original Storage Account Option + bool? OriginalStorageAccountOption { get; set; } + /// ID of the backup copy to be recovered. + string RecoveryPointId { get; set; } + /// Type of this recovery. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get; set; } + /// Region in which the virtual machine is restored. + string Region { get; set; } + /// List of Disk LUNs for partial restore + int[] RestoreDiskLunList { get; set; } + /// Flag to denote of an Unmanaged disk VM should be restored with Managed disks. + bool? RestoreWithManagedDisk { get; set; } + /// Fully qualified ARM ID of the VM which is being recovered. + string SourceResourceId { get; set; } + /// + /// Fully qualified ARM ID of the storage account to which the VM has to be restored. + /// + string StorageAccountId { get; set; } + /// + /// 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. + /// + string SubnetId { get; set; } + /// + /// Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + /// Virtual Machines. + /// + string TargetDomainNameId { get; set; } + /// + /// 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} + /// + string TargetResourceGroupId { get; set; } + /// + /// 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} + /// + string TargetVirtualMachineId { get; set; } + /// + /// 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. + /// + string VirtualNetworkId { get; set; } + /// Target zone where the VM and its disks should be restored. + string[] Zone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreRequest.json.cs new file mode 100644 index 000000000000..02f1572e31ec --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreRequest.json.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific restore. + public partial class IaasVMRestoreRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequest interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "IaasVMRestoreWithRehydrationRequest": + { + return new IaasVMRestoreWithRehydrationRequest(json); + } + } + return new IaasVMRestoreRequest(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IaasVMRestoreRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __restoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest(json); + {_encryptionDetail = If( json?.PropertyT("encryptionDetails"), out var __jsonEncryptionDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.EncryptionDetails.FromJson(__jsonEncryptionDetails) : EncryptionDetail;} + {_identityInfo = If( json?.PropertyT("identityInfo"), out var __jsonIdentityInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IdentityInfo.FromJson(__jsonIdentityInfo) : IdentityInfo;} + {_identityBasedRestoreDetail = If( json?.PropertyT("identityBasedRestoreDetails"), out var __jsonIdentityBasedRestoreDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IdentityBasedRestoreDetails.FromJson(__jsonIdentityBasedRestoreDetails) : IdentityBasedRestoreDetail;} + {_recoveryPointId = If( json?.PropertyT("recoveryPointId"), out var __jsonRecoveryPointId) ? (string)__jsonRecoveryPointId : (string)RecoveryPointId;} + {_recoveryType = If( json?.PropertyT("recoveryType"), out var __jsonRecoveryType) ? (string)__jsonRecoveryType : (string)RecoveryType;} + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + {_targetVirtualMachineId = If( json?.PropertyT("targetVirtualMachineId"), out var __jsonTargetVirtualMachineId) ? (string)__jsonTargetVirtualMachineId : (string)TargetVirtualMachineId;} + {_targetResourceGroupId = If( json?.PropertyT("targetResourceGroupId"), out var __jsonTargetResourceGroupId) ? (string)__jsonTargetResourceGroupId : (string)TargetResourceGroupId;} + {_storageAccountId = If( json?.PropertyT("storageAccountId"), out var __jsonStorageAccountId) ? (string)__jsonStorageAccountId : (string)StorageAccountId;} + {_virtualNetworkId = If( json?.PropertyT("virtualNetworkId"), out var __jsonVirtualNetworkId) ? (string)__jsonVirtualNetworkId : (string)VirtualNetworkId;} + {_subnetId = If( json?.PropertyT("subnetId"), out var __jsonSubnetId) ? (string)__jsonSubnetId : (string)SubnetId;} + {_targetDomainNameId = If( json?.PropertyT("targetDomainNameId"), out var __jsonTargetDomainNameId) ? (string)__jsonTargetDomainNameId : (string)TargetDomainNameId;} + {_region = If( json?.PropertyT("region"), out var __jsonRegion) ? (string)__jsonRegion : (string)Region;} + {_affinityGroup = If( json?.PropertyT("affinityGroup"), out var __jsonAffinityGroup) ? (string)__jsonAffinityGroup : (string)AffinityGroup;} + {_createNewCloudService = If( json?.PropertyT("createNewCloudService"), out var __jsonCreateNewCloudService) ? (bool?)__jsonCreateNewCloudService : CreateNewCloudService;} + {_originalStorageAccountOption = If( json?.PropertyT("originalStorageAccountOption"), out var __jsonOriginalStorageAccountOption) ? (bool?)__jsonOriginalStorageAccountOption : OriginalStorageAccountOption;} + {_restoreDiskLunList = If( json?.PropertyT("restoreDiskLunList"), out var __jsonRestoreDiskLunList) ? If( __jsonRestoreDiskLunList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(int) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber __t ? (int)__t : default(int))) ))() : null : RestoreDiskLunList;} + {_restoreWithManagedDisk = If( json?.PropertyT("restoreWithManagedDisks"), out var __jsonRestoreWithManagedDisks) ? (bool?)__jsonRestoreWithManagedDisks : RestoreWithManagedDisk;} + {_diskEncryptionSetId = If( json?.PropertyT("diskEncryptionSetId"), out var __jsonDiskEncryptionSetId) ? (string)__jsonDiskEncryptionSetId : (string)DiskEncryptionSetId;} + {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : Zone;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __restoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._encryptionDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._encryptionDetail.ToJson(null,serializationMode) : null, "encryptionDetails" ,container.Add ); + AddIf( null != this._identityInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._identityInfo.ToJson(null,serializationMode) : null, "identityInfo" ,container.Add ); + AddIf( null != this._identityBasedRestoreDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._identityBasedRestoreDetail.ToJson(null,serializationMode) : null, "identityBasedRestoreDetails" ,container.Add ); + AddIf( null != (((object)this._recoveryPointId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointId.ToString()) : null, "recoveryPointId" ,container.Add ); + AddIf( null != (((object)this._recoveryType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryType.ToString()) : null, "recoveryType" ,container.Add ); + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + AddIf( null != (((object)this._targetVirtualMachineId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetVirtualMachineId.ToString()) : null, "targetVirtualMachineId" ,container.Add ); + AddIf( null != (((object)this._targetResourceGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetResourceGroupId.ToString()) : null, "targetResourceGroupId" ,container.Add ); + AddIf( null != (((object)this._storageAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._storageAccountId.ToString()) : null, "storageAccountId" ,container.Add ); + AddIf( null != (((object)this._virtualNetworkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._virtualNetworkId.ToString()) : null, "virtualNetworkId" ,container.Add ); + AddIf( null != (((object)this._subnetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._subnetId.ToString()) : null, "subnetId" ,container.Add ); + AddIf( null != (((object)this._targetDomainNameId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetDomainNameId.ToString()) : null, "targetDomainNameId" ,container.Add ); + AddIf( null != (((object)this._region)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._region.ToString()) : null, "region" ,container.Add ); + AddIf( null != (((object)this._affinityGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._affinityGroup.ToString()) : null, "affinityGroup" ,container.Add ); + AddIf( null != this._createNewCloudService ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._createNewCloudService) : null, "createNewCloudService" ,container.Add ); + AddIf( null != this._originalStorageAccountOption ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._originalStorageAccountOption) : null, "originalStorageAccountOption" ,container.Add ); + if (null != this._restoreDiskLunList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._restoreDiskLunList ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber(__x) ,__w.Add); + } + container.Add("restoreDiskLunList",__w); + } + AddIf( null != this._restoreWithManagedDisk ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._restoreWithManagedDisk) : null, "restoreWithManagedDisks" ,container.Add ); + AddIf( null != (((object)this._diskEncryptionSetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._diskEncryptionSetId.ToString()) : null, "diskEncryptionSetId" ,container.Add ); + if (null != this._zone) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._zone ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("zones",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreWithRehydrationRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreWithRehydrationRequest.cs new file mode 100644 index 000000000000..01775f83b813 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreWithRehydrationRequest.cs @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// IaaS VM workload-specific restore with integrated rehydration of recovery point. + /// + public partial class IaasVMRestoreWithRehydrationRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreWithRehydrationRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreWithRehydrationRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequest __iaasVMRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaasVMRestoreRequest(); + + /// + /// Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string AffinityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).AffinityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).AffinityGroup = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? CreateNewCloudService { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).CreateNewCloudService; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).CreateNewCloudService = value ?? default(bool); } + + /// + /// DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest during restore with customer managed key. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DiskEncryptionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).DiskEncryptionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).DiskEncryptionSetId = value ?? null; } + + /// Details needed if the VM was encrypted at the time of backup. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IEncryptionDetails EncryptionDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetail = value ?? null /* model class */; } + + /// + /// Identifies whether this backup copy represents an encrypted VM at the time of backup. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? EncryptionDetailEncryptionEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetailEncryptionEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetailEncryptionEnabled = value ?? default(bool); } + + /// Key Url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EncryptionDetailKekUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetailKekUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetailKekUrl = value ?? null; } + + /// ID of Key Vault where KEK is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EncryptionDetailKekVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetailKekVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetailKekVaultId = value ?? null; } + + /// Secret Url. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EncryptionDetailSecretKeyUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetailSecretKeyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetailSecretKeyUrl = value ?? null; } + + /// ID of Key Vault where Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EncryptionDetailSecretKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetailSecretKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).EncryptionDetailSecretKeyVaultId = value ?? null; } + + /// IaaS VM workload specific restore details for restores using managed identity. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetails IdentityBasedRestoreDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityBasedRestoreDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityBasedRestoreDetail = value ?? null /* model class */; } + + /// Gets the class type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string IdentityBasedRestoreDetailObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityBasedRestoreDetailObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityBasedRestoreDetailObjectType = value ?? null; } + + /// Fully qualified ARM ID of the target storage account. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string IdentityBasedRestoreDetailTargetStorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityBasedRestoreDetailTargetStorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityBasedRestoreDetailTargetStorageAccountId = value ?? null; } + + /// Managed Identity information required to access customer storage account. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfo IdentityInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityInfo = value ?? null /* model class */; } + + /// To differentiate if the managed identity is system assigned or user assigned + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IdentityInfoIsSystemAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityInfoIsSystemAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityInfoIsSystemAssignedIdentity = value ?? default(bool); } + + /// + /// Managed Identity Resource Id + /// Optional: Might not be required in the case of system assigned managed identity + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string IdentityInfoManagedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityInfoManagedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).IdentityInfoManagedIdentityResourceId = value ?? null; } + + /// Internal Acessors for RecoveryPointRehydrationInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreWithRehydrationRequestInternal.RecoveryPointRehydrationInfo { get => (this._recoveryPointRehydrationInfo = this._recoveryPointRehydrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo()); set { {_recoveryPointRehydrationInfo = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__iaasVMRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)__iaasVMRestoreRequest).ObjectType = value ; } + + /// Original Storage Account Option + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? OriginalStorageAccountOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).OriginalStorageAccountOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).OriginalStorageAccountOption = value ?? default(bool); } + + /// ID of the backup copy to be recovered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).RecoveryPointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).RecoveryPointId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo _recoveryPointRehydrationInfo; + + /// RP Rehydration Info + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get => (this._recoveryPointRehydrationInfo = this._recoveryPointRehydrationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo()); set => this._recoveryPointRehydrationInfo = value; } + + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationPriority; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationPriority = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority)""); } + + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationRetentionDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal)RecoveryPointRehydrationInfo).RehydrationRetentionDuration = value ?? null; } + + /// Type of this recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType? RecoveryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).RecoveryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType)""); } + + /// Region in which the virtual machine is restored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Region { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).Region; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).Region = value ?? null; } + + /// List of Disk LUNs for partial restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int[] RestoreDiskLunList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).RestoreDiskLunList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).RestoreDiskLunList = value ?? null /* arrayOf */; } + + /// Flag to denote of an Unmanaged disk VM should be restored with Managed disks. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? RestoreWithManagedDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).RestoreWithManagedDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).RestoreWithManagedDisk = value ?? default(bool); } + + /// Fully qualified ARM ID of the VM which is being recovered. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).SourceResourceId = value ?? null; } + + /// + /// Fully qualified ARM ID of the storage account to which the VM has to be restored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).StorageAccountId = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SubnetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).SubnetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).SubnetId = value ?? null; } + + /// + /// Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + /// Virtual Machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetDomainNameId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).TargetDomainNameId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).TargetDomainNameId = value ?? null; } + + /// + /// 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} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).TargetResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).TargetResourceGroupId = value ?? null; } + + /// + /// 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} + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TargetVirtualMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).TargetVirtualMachineId = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string VirtualNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).VirtualNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).VirtualNetworkId = value ?? null; } + + /// Target zone where the VM and its disks should be restored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal)__iaasVMRestoreRequest).Zone = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public IaasVMRestoreWithRehydrationRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__iaasVMRestoreRequest), __iaasVMRestoreRequest); + await eventListener.AssertObjectIsValid(nameof(__iaasVMRestoreRequest), __iaasVMRestoreRequest); + } + } + /// IaaS VM workload-specific restore with integrated rehydration of recovery point. + public partial interface IIaasVMRestoreWithRehydrationRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequest + { + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rehydration Priority", + SerializedName = @"rehydrationPriority", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How long the rehydrated RP should be kept + Should be ISO8601 Duration format e.g. ""P7D""", + SerializedName = @"rehydrationRetentionDuration", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get; set; } + + } + /// IaaS VM workload-specific restore with integrated rehydration of recovery point. + internal partial interface IIaasVMRestoreWithRehydrationRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreRequestInternal + { + /// RP Rehydration Info + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + /// Rehydration Priority + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RecoveryPointRehydrationInfoRehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + string RecoveryPointRehydrationInfoRehydrationRetentionDuration { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreWithRehydrationRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreWithRehydrationRequest.json.cs new file mode 100644 index 000000000000..c04dbf0d15c7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVMRestoreWithRehydrationRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// IaaS VM workload-specific restore with integrated rehydration of recovery point. + /// + public partial class IaasVMRestoreWithRehydrationRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreWithRehydrationRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreWithRehydrationRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVMRestoreWithRehydrationRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new IaasVMRestoreWithRehydrationRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IaasVMRestoreWithRehydrationRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __iaasVMRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IaasVMRestoreRequest(json); + {_recoveryPointRehydrationInfo = If( json?.PropertyT("recoveryPointRehydrationInfo"), out var __jsonRecoveryPointRehydrationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointRehydrationInfo.FromJson(__jsonRecoveryPointRehydrationInfo) : RecoveryPointRehydrationInfo;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __iaasVMRestoreRequest?.ToJson(container, serializationMode); + AddIf( null != this._recoveryPointRehydrationInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointRehydrationInfo.ToJson(null,serializationMode) : null, "recoveryPointRehydrationInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVmilrRegistrationRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVmilrRegistrationRequest.cs new file mode 100644 index 000000000000..cd902fceb609 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVmilrRegistrationRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Restore files/folders from a backup copy of IaaS VM. + public partial class IaasVmilrRegistrationRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVmilrRegistrationRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVmilrRegistrationRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest __ilrRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IlrRequest(); + + /// Backing field for property. + private string _initiatorName; + + /// iSCSI initiator name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string InitiatorName { get => this._initiatorName; set => this._initiatorName = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestInternal)__ilrRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestInternal)__ilrRequest).ObjectType = value ; } + + /// Backing field for property. + private string _recoveryPointId; + + /// ID of the IaaS VM backup copy from where the files/folders have to be restored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryPointId { get => this._recoveryPointId; set => this._recoveryPointId = value; } + + /// Backing field for property. + private bool? _renewExistingRegistration; + + /// Whether to renew existing registration with the iSCSI server. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? RenewExistingRegistration { get => this._renewExistingRegistration; set => this._renewExistingRegistration = value; } + + /// Backing field for property. + private string _virtualMachineId; + + /// + /// Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VirtualMachineId { get => this._virtualMachineId; set => this._virtualMachineId = value; } + + /// Creates an new instance. + public IaasVmilrRegistrationRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__ilrRequest), __ilrRequest); + await eventListener.AssertObjectIsValid(nameof(__ilrRequest), __ilrRequest); + } + } + /// Restore files/folders from a backup copy of IaaS VM. + public partial interface IIaasVmilrRegistrationRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest + { + /// iSCSI initiator name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"iSCSI initiator name.", + SerializedName = @"initiatorName", + PossibleTypes = new [] { typeof(string) })] + string InitiatorName { get; set; } + /// ID of the IaaS VM backup copy from where the files/folders have to be restored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the IaaS VM backup copy from where the files/folders have to be restored.", + SerializedName = @"recoveryPointId", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointId { get; set; } + /// Whether to renew existing registration with the iSCSI server. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to renew existing registration with the iSCSI server.", + SerializedName = @"renewExistingRegistration", + PossibleTypes = new [] { typeof(bool) })] + bool? RenewExistingRegistration { get; set; } + /// + /// Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored.", + SerializedName = @"virtualMachineId", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineId { get; set; } + + } + /// Restore files/folders from a backup copy of IaaS VM. + internal partial interface IIaasVmilrRegistrationRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestInternal + { + /// iSCSI initiator name. + string InitiatorName { get; set; } + /// ID of the IaaS VM backup copy from where the files/folders have to be restored. + string RecoveryPointId { get; set; } + /// Whether to renew existing registration with the iSCSI server. + bool? RenewExistingRegistration { get; set; } + /// + /// Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. + /// + string VirtualMachineId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVmilrRegistrationRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVmilrRegistrationRequest.json.cs new file mode 100644 index 000000000000..ad24c9e81712 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IaasVmilrRegistrationRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Restore files/folders from a backup copy of IaaS VM. + public partial class IaasVmilrRegistrationRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVmilrRegistrationRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVmilrRegistrationRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIaasVmilrRegistrationRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new IaasVmilrRegistrationRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IaasVmilrRegistrationRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __ilrRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IlrRequest(json); + {_recoveryPointId = If( json?.PropertyT("recoveryPointId"), out var __jsonRecoveryPointId) ? (string)__jsonRecoveryPointId : (string)RecoveryPointId;} + {_virtualMachineId = If( json?.PropertyT("virtualMachineId"), out var __jsonVirtualMachineId) ? (string)__jsonVirtualMachineId : (string)VirtualMachineId;} + {_initiatorName = If( json?.PropertyT("initiatorName"), out var __jsonInitiatorName) ? (string)__jsonInitiatorName : (string)InitiatorName;} + {_renewExistingRegistration = If( json?.PropertyT("renewExistingRegistration"), out var __jsonRenewExistingRegistration) ? (bool?)__jsonRenewExistingRegistration : RenewExistingRegistration;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __ilrRequest?.ToJson(container, serializationMode); + AddIf( null != (((object)this._recoveryPointId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointId.ToString()) : null, "recoveryPointId" ,container.Add ); + AddIf( null != (((object)this._virtualMachineId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._virtualMachineId.ToString()) : null, "virtualMachineId" ,container.Add ); + AddIf( null != (((object)this._initiatorName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._initiatorName.ToString()) : null, "initiatorName" ,container.Add ); + AddIf( null != this._renewExistingRegistration ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._renewExistingRegistration) : null, "renewExistingRegistration" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityBasedRestoreDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityBasedRestoreDetails.cs new file mode 100644 index 000000000000..9f64cc91f475 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityBasedRestoreDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload specific restore details for restores using managed identity + public partial class IdentityBasedRestoreDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetailsInternal + { + + /// Backing field for property. + private string _objectType; + + /// Gets the class type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Backing field for property. + private string _targetStorageAccountId; + + /// Fully qualified ARM ID of the target storage account. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetStorageAccountId { get => this._targetStorageAccountId; set => this._targetStorageAccountId = value; } + + /// Creates an new instance. + public IdentityBasedRestoreDetails() + { + + } + } + /// IaaS VM workload specific restore details for restores using managed identity + public partial interface IIdentityBasedRestoreDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Gets the class type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets the class type.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + /// Fully qualified ARM ID of the target storage account. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ARM ID of the target storage account.", + SerializedName = @"targetStorageAccountId", + PossibleTypes = new [] { typeof(string) })] + string TargetStorageAccountId { get; set; } + + } + /// IaaS VM workload specific restore details for restores using managed identity + internal partial interface IIdentityBasedRestoreDetailsInternal + + { + /// Gets the class type. + string ObjectType { get; set; } + /// Fully qualified ARM ID of the target storage account. + string TargetStorageAccountId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityBasedRestoreDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityBasedRestoreDetails.json.cs new file mode 100644 index 000000000000..f275259c2c61 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityBasedRestoreDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload specific restore details for restores using managed identity + public partial class IdentityBasedRestoreDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityBasedRestoreDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new IdentityBasedRestoreDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityBasedRestoreDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + {_targetStorageAccountId = If( json?.PropertyT("targetStorageAccountId"), out var __jsonTargetStorageAccountId) ? (string)__jsonTargetStorageAccountId : (string)TargetStorageAccountId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AddIf( null != (((object)this._targetStorageAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetStorageAccountId.ToString()) : null, "targetStorageAccountId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityInfo.cs new file mode 100644 index 000000000000..8a2a1db27106 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Encapsulates Managed Identity related information + public partial class IdentityInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfoInternal + { + + /// Backing field for property. + private bool? _isSystemAssignedIdentity; + + /// To differentiate if the managed identity is system assigned or user assigned + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsSystemAssignedIdentity { get => this._isSystemAssignedIdentity; set => this._isSystemAssignedIdentity = value; } + + /// Backing field for property. + private string _managedIdentityResourceId; + + /// + /// Managed Identity Resource Id + /// Optional: Might not be required in the case of system assigned managed identity + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ManagedIdentityResourceId { get => this._managedIdentityResourceId; set => this._managedIdentityResourceId = value; } + + /// Creates an new instance. + public IdentityInfo() + { + + } + } + /// Encapsulates Managed Identity related information + public partial interface IIdentityInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// To differentiate if the managed identity is system assigned or user assigned + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To differentiate if the managed identity is system assigned or user assigned", + SerializedName = @"isSystemAssignedIdentity", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSystemAssignedIdentity { get; set; } + /// + /// Managed Identity Resource Id + /// Optional: Might not be required in the case of system assigned managed identity + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Managed Identity Resource Id + Optional: Might not be required in the case of system assigned managed identity", + SerializedName = @"managedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string ManagedIdentityResourceId { get; set; } + + } + /// Encapsulates Managed Identity related information + internal partial interface IIdentityInfoInternal + + { + /// To differentiate if the managed identity is system assigned or user assigned + bool? IsSystemAssignedIdentity { get; set; } + /// + /// Managed Identity Resource Id + /// Optional: Might not be required in the case of system assigned managed identity + /// + string ManagedIdentityResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityInfo.json.cs new file mode 100644 index 000000000000..cf0cbea3c59b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IdentityInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Encapsulates Managed Identity related information + public partial class IdentityInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIdentityInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new IdentityInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_isSystemAssignedIdentity = If( json?.PropertyT("isSystemAssignedIdentity"), out var __jsonIsSystemAssignedIdentity) ? (bool?)__jsonIsSystemAssignedIdentity : IsSystemAssignedIdentity;} + {_managedIdentityResourceId = If( json?.PropertyT("managedIdentityResourceId"), out var __jsonManagedIdentityResourceId) ? (string)__jsonManagedIdentityResourceId : (string)ManagedIdentityResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._isSystemAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isSystemAssignedIdentity) : null, "isSystemAssignedIdentity" ,container.Add ); + AddIf( null != (((object)this._managedIdentityResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._managedIdentityResourceId.ToString()) : null, "managedIdentityResourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequest.cs new file mode 100644 index 000000000000..1bf5f0b6e06e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Parameters to Provision ILR API. + public partial class IlrRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestInternal + { + + /// Backing field for property. + private string _objectType; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Creates an new instance. + public IlrRequest() + { + + } + } + /// Parameters to Provision ILR API. + public partial interface IIlrRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Parameters to Provision ILR API. + internal partial interface IIlrRequestInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequest.json.cs new file mode 100644 index 000000000000..178c9b055ebe --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequest.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Parameters to Provision ILR API. + public partial class IlrRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureFileShareProvisionILRRequest": + { + return new AzureFileShareProvisionIlrRequest(json); + } + case "IaasVMILRRegistrationRequest": + { + return new IaasVmilrRegistrationRequest(json); + } + } + return new IlrRequest(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IlrRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequestResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequestResource.cs new file mode 100644 index 000000000000..84be5e1f4431 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequestResource.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Parameters to Provision ILR API. + public partial class IlrRequestResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IlrRequest()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestInternal)Property).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestInternal)Property).ObjectType = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest _property; + + /// ILRRequestResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IlrRequest()); set => this._property = value; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public IlrRequestResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Parameters to Provision ILR API. + public partial interface IIlrRequestResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Parameters to Provision ILR API. + internal partial interface IIlrRequestResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + /// ILRRequestResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequest Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequestResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequestResource.json.cs new file mode 100644 index 000000000000..5233793d12c0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/IlrRequestResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Parameters to Provision ILR API. + public partial class IlrRequestResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new IlrRequestResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal IlrRequestResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IlrRequest.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryInfo.cs new file mode 100644 index 000000000000..bc119a33b3ac --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Details about inquired protectable items under a given container. + public partial class InquiryInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail _errorDetail; + + /// Error Details if the Status is non-success. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail ErrorDetail { get => (this._errorDetail = this._errorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail()); set => this._errorDetail = value; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Code; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Message; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Recommendation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] _inquiryDetail; + + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryDetail { get => this._inquiryDetail; set => this._inquiryDetail = value; } + + /// Internal Acessors for ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal.ErrorDetail { get => (this._errorDetail = this._errorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail()); set { {_errorDetail = value;} } } + + /// Internal Acessors for ErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal.ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Code = value; } + + /// Internal Acessors for ErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal.ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Message = value; } + + /// Internal Acessors for ErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfoInternal.ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Recommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Recommendation = value; } + + /// Backing field for property. + private string _status; + + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public InquiryInfo() + { + + } + } + /// Details about inquired protectable items under a given container. + public partial interface IInquiryInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailCode { get; } + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message related to the Code.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailMessage { get; } + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of recommendation strings.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] ErrorDetailRecommendation { get; } + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Inquiry Details which will have workload specific details. + For e.g. - For SQL and oracle this will contain different details.", + SerializedName = @"inquiryDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryDetail { get; set; } + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Inquiry Status for this container such as + InProgress | Failed | Succeeded", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + + } + /// Details about inquired protectable items under a given container. + internal partial interface IInquiryInfoInternal + + { + /// Error Details if the Status is non-success. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail ErrorDetail { get; set; } + /// Error code. + string ErrorDetailCode { get; set; } + /// Error Message related to the Code. + string ErrorDetailMessage { get; set; } + /// List of recommendation strings. + string[] ErrorDetailRecommendation { get; set; } + /// + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails[] InquiryDetail { get; set; } + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + string Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryInfo.json.cs new file mode 100644 index 000000000000..4ad877fac0a3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Details about inquired protectable items under a given container. + public partial class InquiryInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new InquiryInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal InquiryInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorDetail = If( json?.PropertyT("errorDetail"), out var __jsonErrorDetail) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail.FromJson(__jsonErrorDetail) : ErrorDetail;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_inquiryDetail = If( json?.PropertyT("inquiryDetails"), out var __jsonInquiryDetails) ? If( __jsonInquiryDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadInquiryDetails.FromJson(__u) )) ))() : null : InquiryDetail;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._errorDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._errorDetail.ToJson(null,serializationMode) : null, "errorDetail" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + if (null != this._inquiryDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._inquiryDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("inquiryDetails",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryValidation.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryValidation.cs new file mode 100644 index 000000000000..ccfc6f292af6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryValidation.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Validation for inquired protectable items under a given container. + public partial class InquiryValidation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidation, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal + { + + /// Backing field for property. + private string _additionalDetail; + + /// Error Additional Detail in case the status is non-success. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AdditionalDetail { get => this._additionalDetail; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail _errorDetail; + + /// Error Detail in case the status is non-success. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail ErrorDetail { get => (this._errorDetail = this._errorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail()); set => this._errorDetail = value; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Code; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Message; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Recommendation; } + + /// Internal Acessors for AdditionalDetail + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal.AdditionalDetail { get => this._additionalDetail; set { {_additionalDetail = value;} } } + + /// Internal Acessors for ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal.ErrorDetail { get => (this._errorDetail = this._errorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail()); set { {_errorDetail = value;} } } + + /// Internal Acessors for ErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal.ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Code = value; } + + /// Internal Acessors for ErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal.ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Message = value; } + + /// Internal Acessors for ErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal.ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Recommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetailInternal)ErrorDetail).Recommendation = value; } + + /// Backing field for property. + private string _status; + + /// Status for the Inquiry Validation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public InquiryValidation() + { + + } + } + /// Validation for inquired protectable items under a given container. + public partial interface IInquiryValidation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error Additional Detail in case the status is non-success. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Additional Detail in case the status is non-success.", + SerializedName = @"additionalDetail", + PossibleTypes = new [] { typeof(string) })] + string AdditionalDetail { get; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailCode { get; } + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message related to the Code.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailMessage { get; } + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of recommendation strings.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] ErrorDetailRecommendation { get; } + /// Status for the Inquiry Validation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status for the Inquiry Validation.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + + } + /// Validation for inquired protectable items under a given container. + internal partial interface IInquiryValidationInternal + + { + /// Error Additional Detail in case the status is non-success. + string AdditionalDetail { get; set; } + /// Error Detail in case the status is non-success. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail ErrorDetail { get; set; } + /// Error code. + string ErrorDetailCode { get; set; } + /// Error Message related to the Code. + string ErrorDetailMessage { get; set; } + /// List of recommendation strings. + string[] ErrorDetailRecommendation { get; set; } + /// Status for the Inquiry Validation. + string Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryValidation.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryValidation.json.cs new file mode 100644 index 000000000000..a48b376a4c46 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InquiryValidation.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Validation for inquired protectable items under a given container. + public partial class InquiryValidation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidation FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new InquiryValidation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal InquiryValidation(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorDetail = If( json?.PropertyT("errorDetail"), out var __jsonErrorDetail) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail.FromJson(__jsonErrorDetail) : ErrorDetail;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_additionalDetail = If( json?.PropertyT("additionalDetail"), out var __jsonAdditionalDetail) ? (string)__jsonAdditionalDetail : (string)AdditionalDetail;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._errorDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._errorDetail.ToJson(null,serializationMode) : null, "errorDetail" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._additionalDetail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._additionalDetail.ToString()) : null, "additionalDetail" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantItemRecoveryTarget.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantItemRecoveryTarget.cs new file mode 100644 index 000000000000..dfbbe0c4497f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantItemRecoveryTarget.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Target details for file / folder restore. + public partial class InstantItemRecoveryTarget : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTarget, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTargetInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect[] _clientScript; + + /// List of client scripts. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect[] ClientScript { get => this._clientScript; set => this._clientScript = value; } + + /// Creates an new instance. + public InstantItemRecoveryTarget() + { + + } + } + /// Target details for file / folder restore. + public partial interface IInstantItemRecoveryTarget : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of client scripts. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of client scripts.", + SerializedName = @"clientScripts", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect[] ClientScript { get; set; } + + } + /// Target details for file / folder restore. + internal partial interface IInstantItemRecoveryTargetInternal + + { + /// List of client scripts. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect[] ClientScript { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantItemRecoveryTarget.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantItemRecoveryTarget.json.cs new file mode 100644 index 000000000000..add2a0d22401 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantItemRecoveryTarget.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Target details for file / folder restore. + public partial class InstantItemRecoveryTarget + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTarget. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTarget. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTarget FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new InstantItemRecoveryTarget(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal InstantItemRecoveryTarget(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clientScript = If( json?.PropertyT("clientScripts"), out var __jsonClientScripts) ? If( __jsonClientScripts as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientScriptForConnect.FromJson(__u) )) ))() : null : ClientScript;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._clientScript) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._clientScript ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("clientScripts",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantRpAdditionalDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantRpAdditionalDetails.cs new file mode 100644 index 000000000000..da808ca326fb --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantRpAdditionalDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class InstantRpAdditionalDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetailsInternal + { + + /// Backing field for property. + private string _azureBackupRgNamePrefix; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AzureBackupRgNamePrefix { get => this._azureBackupRgNamePrefix; set => this._azureBackupRgNamePrefix = value; } + + /// Backing field for property. + private string _azureBackupRgNameSuffix; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AzureBackupRgNameSuffix { get => this._azureBackupRgNameSuffix; set => this._azureBackupRgNameSuffix = value; } + + /// Creates an new instance. + public InstantRpAdditionalDetails() + { + + } + } + public partial interface IInstantRpAdditionalDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"azureBackupRGNamePrefix", + PossibleTypes = new [] { typeof(string) })] + string AzureBackupRgNamePrefix { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"azureBackupRGNameSuffix", + PossibleTypes = new [] { typeof(string) })] + string AzureBackupRgNameSuffix { get; set; } + + } + internal partial interface IInstantRpAdditionalDetailsInternal + + { + string AzureBackupRgNamePrefix { get; set; } + + string AzureBackupRgNameSuffix { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantRpAdditionalDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantRpAdditionalDetails.json.cs new file mode 100644 index 000000000000..b3b93f60f266 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/InstantRpAdditionalDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class InstantRpAdditionalDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantRpAdditionalDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new InstantRpAdditionalDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal InstantRpAdditionalDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_azureBackupRgNamePrefix = If( json?.PropertyT("azureBackupRGNamePrefix"), out var __jsonAzureBackupRgNamePrefix) ? (string)__jsonAzureBackupRgNamePrefix : (string)AzureBackupRgNamePrefix;} + {_azureBackupRgNameSuffix = If( json?.PropertyT("azureBackupRGNameSuffix"), out var __jsonAzureBackupRgNameSuffix) ? (string)__jsonAzureBackupRgNameSuffix : (string)AzureBackupRgNameSuffix;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._azureBackupRgNamePrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._azureBackupRgNamePrefix.ToString()) : null, "azureBackupRGNamePrefix" ,container.Add ); + AddIf( null != (((object)this._azureBackupRgNameSuffix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._azureBackupRgNameSuffix.ToString()) : null, "azureBackupRGNameSuffix" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Job.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Job.cs new file mode 100644 index 000000000000..92b57309b2f1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Job.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Defines workload agnostic properties for a job. + public partial class Job : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal + { + + /// Backing field for property. + private string _activityId; + + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ActivityId { get => this._activityId; set => this._activityId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } + + /// Backing field for property. + private string _entityFriendlyName; + + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string EntityFriendlyName { get => this._entityFriendlyName; set => this._entityFriendlyName = value; } + + /// Backing field for property. + private string _operation; + + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private string _status; + + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string _type; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public Job() + { + + } + } + /// Defines workload agnostic properties for a job. + public partial interface IJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ActivityId of job.", + SerializedName = @"activityId", + PossibleTypes = new [] { typeof(string) })] + string ActivityId { get; set; } + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type to execute the current job.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end time.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the entity on which the current job is executing.", + SerializedName = @"entityFriendlyName", + PossibleTypes = new [] { typeof(string) })] + string EntityFriendlyName { get; set; } + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operation name.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"jobType", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// Defines workload agnostic properties for a job. + internal partial interface IJobInternal + + { + /// ActivityId of job. + string ActivityId { get; set; } + /// Backup management type to execute the current job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// The end time. + global::System.DateTime? EndTime { get; set; } + /// Friendly name of the entity on which the current job is executing. + string EntityFriendlyName { get; set; } + /// The operation name. + string Operation { get; set; } + /// The start time. + global::System.DateTime? StartTime { get; set; } + /// Job status. + string Status { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Job.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Job.json.cs new file mode 100644 index 000000000000..458fdbc197ea --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Job.json.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Defines workload agnostic properties for a job. + public partial class Job + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("jobType") ) + { + case "AzureIaaSVMJob": + { + return new AzureIaaSvmJob(json); + } + case "AzureIaaSVMJobV2": + { + return new AzureIaaSvmJobV2(json); + } + case "AzureStorageJob": + { + return new AzureStorageJob(json); + } + case "AzureWorkloadJob": + { + return new AzureWorkloadJob(json); + } + case "DpmJob": + { + return new DpmJob(json); + } + case "MabJob": + { + return new MabJob(json); + } + case "VaultJob": + { + return new VaultJob(json); + } + } + return new Job(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal Job(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_entityFriendlyName = If( json?.PropertyT("entityFriendlyName"), out var __jsonEntityFriendlyName) ? (string)__jsonEntityFriendlyName : (string)EntityFriendlyName;} + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} + {_activityId = If( json?.PropertyT("activityId"), out var __jsonActivityId) ? (string)__jsonActivityId : (string)ActivityId;} + {_type = If( json?.PropertyT("jobType"), out var __jsonJobType) ? (string)__jsonJobType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._entityFriendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._entityFriendlyName.ToString()) : null, "entityFriendlyName" ,container.Add ); + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + AddIf( null != (((object)this._activityId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._activityId.ToString()) : null, "activityId" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "jobType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobQueryObject.cs new file mode 100644 index 000000000000..79b6e8ac9162 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list the jobs. + public partial class JobQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobQueryObjectInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Type of backup management for the job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// Job has ended at this time. Value is in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } + + /// Backing field for property. + private string _jobId; + + /// JobID represents the job uniquely. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string JobId { get => this._jobId; set => this._jobId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType? _operation; + + /// Type of operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType? Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// Job has started at this time. Value is in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus? _status; + + /// Status of the job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public JobQueryObject() + { + + } + } + /// Filters to list the jobs. + public partial interface IJobQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Type of backup management for the job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the job.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Job has ended at this time. Value is in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job has ended at this time. Value is in UTC.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// JobID represents the job uniquely. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"JobID represents the job uniquely.", + SerializedName = @"jobId", + PossibleTypes = new [] { typeof(string) })] + string JobId { get; set; } + /// Type of operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of operation.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType? Operation { get; set; } + /// Job has started at this time. Value is in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job has started at this time. Value is in UTC.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// Status of the job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the job.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus? Status { get; set; } + + } + /// Filters to list the jobs. + internal partial interface IJobQueryObjectInternal + + { + /// Type of backup management for the job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Job has ended at this time. Value is in UTC. + global::System.DateTime? EndTime { get; set; } + /// JobID represents the job uniquely. + string JobId { get; set; } + /// Type of operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType? Operation { get; set; } + /// Job has started at this time. Value is in UTC. + global::System.DateTime? StartTime { get; set; } + /// Status of the job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobQueryObject.json.cs new file mode 100644 index 000000000000..b9be05b58721 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list the jobs. + public partial class JobQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new JobQueryObject(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal JobQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_jobId = If( json?.PropertyT("jobId"), out var __jsonJobId) ? (string)__jsonJobId : (string)JobId;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AddIf( null != (((object)this._jobId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._jobId.ToString()) : null, "jobId" ,container.Add ); + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResource.cs new file mode 100644 index 000000000000..6d8d6f2c1a9c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResource.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Defines workload agnostic properties for a job. + public partial class JobResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ActivityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).ActivityId = value ?? null; } + + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? EndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).EndTime = value ?? default(global::System.DateTime); } + + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string EntityFriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).EntityFriendlyName = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string JobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).Type = value ?? null; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Operation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).Operation = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob _property; + + /// JobResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job()); set => this._property = value; } + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).StartTime = value ?? default(global::System.DateTime); } + + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)Property).Status = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public JobResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Defines workload agnostic properties for a job. + public partial interface IJobResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ActivityId of job.", + SerializedName = @"activityId", + PossibleTypes = new [] { typeof(string) })] + string ActivityId { get; set; } + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type to execute the current job.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end time.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the entity on which the current job is executing.", + SerializedName = @"entityFriendlyName", + PossibleTypes = new [] { typeof(string) })] + string EntityFriendlyName { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"jobType", + PossibleTypes = new [] { typeof(string) })] + string JobType { get; set; } + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operation name.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + + } + /// Defines workload agnostic properties for a job. + internal partial interface IJobResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// ActivityId of job. + string ActivityId { get; set; } + /// Backup management type to execute the current job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// The end time. + global::System.DateTime? EndTime { get; set; } + /// Friendly name of the entity on which the current job is executing. + string EntityFriendlyName { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string JobType { get; set; } + /// The operation name. + string Operation { get; set; } + /// JobResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob Property { get; set; } + /// The start time. + global::System.DateTime? StartTime { get; set; } + /// Job status. + string Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResource.json.cs new file mode 100644 index 000000000000..ae95fd5ac05a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Defines workload agnostic properties for a job. + public partial class JobResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new JobResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal JobResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResourceList.cs new file mode 100644 index 000000000000..6cb969888829 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of Job resources + public partial class JobResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public JobResourceList() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + } + /// List of Job resources + public partial interface IJobResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResource[] Value { get; set; } + + } + /// List of Job resources + internal partial interface IJobResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResourceList.json.cs new file mode 100644 index 000000000000..8344fdf4f630 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/JobResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of Job resources + public partial class JobResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new JobResourceList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal JobResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.JobResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KekDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KekDetails.cs new file mode 100644 index 000000000000..9b094a9780b8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KekDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// KEK is encryption key for BEK. + public partial class KekDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetailsInternal + { + + /// Backing field for property. + private string _keyBackupData; + + /// KEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string KeyBackupData { get => this._keyBackupData; set => this._keyBackupData = value; } + + /// Backing field for property. + private string _keyUrl; + + /// Key is KEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string KeyUrl { get => this._keyUrl; set => this._keyUrl = value; } + + /// Backing field for property. + private string _keyVaultId; + + /// Key Vault ID where this Key is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string KeyVaultId { get => this._keyVaultId; set => this._keyVaultId = value; } + + /// Creates an new instance. + public KekDetails() + { + + } + } + /// KEK is encryption key for BEK. + public partial interface IKekDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// KEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"KEK data.", + SerializedName = @"keyBackupData", + PossibleTypes = new [] { typeof(string) })] + string KeyBackupData { get; set; } + /// Key is KEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key is KEK.", + SerializedName = @"keyUrl", + PossibleTypes = new [] { typeof(string) })] + string KeyUrl { get; set; } + /// Key Vault ID where this Key is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Vault ID where this Key is stored.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultId { get; set; } + + } + /// KEK is encryption key for BEK. + internal partial interface IKekDetailsInternal + + { + /// KEK data. + string KeyBackupData { get; set; } + /// Key is KEK. + string KeyUrl { get; set; } + /// Key Vault ID where this Key is stored. + string KeyVaultId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KekDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KekDetails.json.cs new file mode 100644 index 000000000000..d7f17d45fdcd --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KekDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// KEK is encryption key for BEK. + public partial class KekDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new KekDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal KekDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyUrl = If( json?.PropertyT("keyUrl"), out var __jsonKeyUrl) ? (string)__jsonKeyUrl : (string)KeyUrl;} + {_keyVaultId = If( json?.PropertyT("keyVaultId"), out var __jsonKeyVaultId) ? (string)__jsonKeyVaultId : (string)KeyVaultId;} + {_keyBackupData = If( json?.PropertyT("keyBackupData"), out var __jsonKeyBackupData) ? (string)__jsonKeyBackupData : (string)KeyBackupData;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._keyUrl.ToString()) : null, "keyUrl" ,container.Add ); + AddIf( null != (((object)this._keyVaultId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._keyVaultId.ToString()) : null, "keyVaultId" ,container.Add ); + AddIf( null != (((object)this._keyBackupData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._keyBackupData.ToString()) : null, "keyBackupData" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KeyAndSecretDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KeyAndSecretDetails.cs new file mode 100644 index 000000000000..b1bb4ec2cf2c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KeyAndSecretDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// 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 : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetails _bekDetail; + + /// BEK is bitlocker encryption key. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetails BekDetail { get => (this._bekDetail = this._bekDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BekDetails()); set => this._bekDetail = value; } + + /// BEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BekDetailSecretData { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetailsInternal)BekDetail).SecretData; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetailsInternal)BekDetail).SecretData = value ?? null; } + + /// Secret is BEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BekDetailSecretUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetailsInternal)BekDetail).SecretUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetailsInternal)BekDetail).SecretUrl = value ?? null; } + + /// ID of the Key Vault where this Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BekDetailSecretVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetailsInternal)BekDetail).SecretVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetailsInternal)BekDetail).SecretVaultId = value ?? null; } + + /// Backing field for property. + private string _encryptionMechanism; + + /// Encryption mechanism: None/ SinglePass/ DoublePass + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string EncryptionMechanism { get => this._encryptionMechanism; set => this._encryptionMechanism = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetails _kekDetail; + + /// KEK is encryption key for BEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetails KekDetail { get => (this._kekDetail = this._kekDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.KekDetails()); set => this._kekDetail = value; } + + /// KEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string KekDetailKeyBackupData { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetailsInternal)KekDetail).KeyBackupData; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetailsInternal)KekDetail).KeyBackupData = value ?? null; } + + /// Key is KEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string KekDetailKeyUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetailsInternal)KekDetail).KeyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetailsInternal)KekDetail).KeyUrl = value ?? null; } + + /// Key Vault ID where this Key is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string KekDetailKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetailsInternal)KekDetail).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetailsInternal)KekDetail).KeyVaultId = value ?? null; } + + /// Internal Acessors for BekDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal.BekDetail { get => (this._bekDetail = this._bekDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BekDetails()); set { {_bekDetail = value;} } } + + /// Internal Acessors for KekDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetailsInternal.KekDetail { get => (this._kekDetail = this._kekDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.KekDetails()); set { {_kekDetail = value;} } } + + /// Creates an new instance. + public KeyAndSecretDetails() + { + + } + } + /// 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 interface IKeyAndSecretDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// BEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"BEK data.", + SerializedName = @"secretData", + PossibleTypes = new [] { typeof(string) })] + string BekDetailSecretData { get; set; } + /// Secret is BEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secret is BEK.", + SerializedName = @"secretUrl", + PossibleTypes = new [] { typeof(string) })] + string BekDetailSecretUrl { get; set; } + /// ID of the Key Vault where this Secret is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the Key Vault where this Secret is stored.", + SerializedName = @"secretVaultId", + PossibleTypes = new [] { typeof(string) })] + string BekDetailSecretVaultId { get; set; } + /// Encryption mechanism: None/ SinglePass/ DoublePass + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption mechanism: None/ SinglePass/ DoublePass", + SerializedName = @"encryptionMechanism", + PossibleTypes = new [] { typeof(string) })] + string EncryptionMechanism { get; set; } + /// KEK data. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"KEK data.", + SerializedName = @"keyBackupData", + PossibleTypes = new [] { typeof(string) })] + string KekDetailKeyBackupData { get; set; } + /// Key is KEK. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key is KEK.", + SerializedName = @"keyUrl", + PossibleTypes = new [] { typeof(string) })] + string KekDetailKeyUrl { get; set; } + /// Key Vault ID where this Key is stored. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key Vault ID where this Key is stored.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string KekDetailKeyVaultId { get; set; } + + } + /// 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. + internal partial interface IKeyAndSecretDetailsInternal + + { + /// BEK is bitlocker encryption key. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBekDetails BekDetail { get; set; } + /// BEK data. + string BekDetailSecretData { get; set; } + /// Secret is BEK. + string BekDetailSecretUrl { get; set; } + /// ID of the Key Vault where this Secret is stored. + string BekDetailSecretVaultId { get; set; } + /// Encryption mechanism: None/ SinglePass/ DoublePass + string EncryptionMechanism { get; set; } + /// KEK is encryption key for BEK. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKekDetails KekDetail { get; set; } + /// KEK data. + string KekDetailKeyBackupData { get; set; } + /// Key is KEK. + string KekDetailKeyUrl { get; set; } + /// Key Vault ID where this Key is stored. + string KekDetailKeyVaultId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KeyAndSecretDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KeyAndSecretDetails.json.cs new file mode 100644 index 000000000000..c59660a62247 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KeyAndSecretDetails.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// 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 + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKeyAndSecretDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new KeyAndSecretDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal KeyAndSecretDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_kekDetail = If( json?.PropertyT("kekDetails"), out var __jsonKekDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.KekDetails.FromJson(__jsonKekDetails) : KekDetail;} + {_bekDetail = If( json?.PropertyT("bekDetails"), out var __jsonBekDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BekDetails.FromJson(__jsonBekDetails) : BekDetail;} + {_encryptionMechanism = If( json?.PropertyT("encryptionMechanism"), out var __jsonEncryptionMechanism) ? (string)__jsonEncryptionMechanism : (string)EncryptionMechanism;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._kekDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._kekDetail.ToJson(null,serializationMode) : null, "kekDetails" ,container.Add ); + AddIf( null != this._bekDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._bekDetail.ToJson(null,serializationMode) : null, "bekDetails" ,container.Add ); + AddIf( null != (((object)this._encryptionMechanism)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._encryptionMechanism.ToString()) : null, "encryptionMechanism" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KpiResourceHealthDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KpiResourceHealthDetails.cs new file mode 100644 index 000000000000..1d67236a2a18 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KpiResourceHealthDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// KPI Resource Health Details + public partial class KpiResourceHealthDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetailsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails[] _resourceHealthDetail; + + /// Resource Health Status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails[] ResourceHealthDetail { get => this._resourceHealthDetail; set => this._resourceHealthDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus? _resourceHealthStatus; + + /// Resource Health Status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus? ResourceHealthStatus { get => this._resourceHealthStatus; set => this._resourceHealthStatus = value; } + + /// Creates an new instance. + public KpiResourceHealthDetails() + { + + } + } + /// KPI Resource Health Details + public partial interface IKpiResourceHealthDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Resource Health Status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Health Status", + SerializedName = @"resourceHealthDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails[] ResourceHealthDetail { get; set; } + /// Resource Health Status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Health Status", + SerializedName = @"resourceHealthStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus? ResourceHealthStatus { get; set; } + + } + /// KPI Resource Health Details + internal partial interface IKpiResourceHealthDetailsInternal + + { + /// Resource Health Status + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails[] ResourceHealthDetail { get; set; } + /// Resource Health Status + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus? ResourceHealthStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KpiResourceHealthDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KpiResourceHealthDetails.json.cs new file mode 100644 index 000000000000..aa01989655f4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/KpiResourceHealthDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// KPI Resource Health Details + public partial class KpiResourceHealthDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IKpiResourceHealthDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new KpiResourceHealthDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal KpiResourceHealthDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceHealthStatus = If( json?.PropertyT("resourceHealthStatus"), out var __jsonResourceHealthStatus) ? (string)__jsonResourceHealthStatus : (string)ResourceHealthStatus;} + {_resourceHealthDetail = If( json?.PropertyT("resourceHealthDetails"), out var __jsonResourceHealthDetails) ? If( __jsonResourceHealthDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceHealthDetails.FromJson(__u) )) ))() : null : ResourceHealthDetail;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceHealthStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceHealthStatus.ToString()) : null, "resourceHealthStatus" ,container.Add ); + if (null != this._resourceHealthDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._resourceHealthDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("resourceHealthDetails",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ListRecoveryPointsRecommendedForMoveRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ListRecoveryPointsRecommendedForMoveRequest.cs new file mode 100644 index 000000000000..d0f49818d94e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ListRecoveryPointsRecommendedForMoveRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// ListRecoveryPointsRecommendedForMoveRequest Request + public partial class ListRecoveryPointsRecommendedForMoveRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IListRecoveryPointsRecommendedForMoveRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IListRecoveryPointsRecommendedForMoveRequestInternal + { + + /// Backing field for property. + private string[] _excludedRpList; + + /// List of Recovery Points excluded from Move + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] ExcludedRpList { get => this._excludedRpList; set => this._excludedRpList = value; } + + /// Backing field for property. + private string _objectType; + + /// Gets the class type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// + /// Creates an new instance. + /// + public ListRecoveryPointsRecommendedForMoveRequest() + { + + } + } + /// ListRecoveryPointsRecommendedForMoveRequest Request + public partial interface IListRecoveryPointsRecommendedForMoveRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of Recovery Points excluded from Move + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Recovery Points excluded from Move", + SerializedName = @"excludedRPList", + PossibleTypes = new [] { typeof(string) })] + string[] ExcludedRpList { get; set; } + /// Gets the class type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets the class type.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// ListRecoveryPointsRecommendedForMoveRequest Request + internal partial interface IListRecoveryPointsRecommendedForMoveRequestInternal + + { + /// List of Recovery Points excluded from Move + string[] ExcludedRpList { get; set; } + /// Gets the class type. + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ListRecoveryPointsRecommendedForMoveRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ListRecoveryPointsRecommendedForMoveRequest.json.cs new file mode 100644 index 000000000000..82665de198af --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ListRecoveryPointsRecommendedForMoveRequest.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// ListRecoveryPointsRecommendedForMoveRequest Request + public partial class ListRecoveryPointsRecommendedForMoveRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IListRecoveryPointsRecommendedForMoveRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IListRecoveryPointsRecommendedForMoveRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IListRecoveryPointsRecommendedForMoveRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ListRecoveryPointsRecommendedForMoveRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ListRecoveryPointsRecommendedForMoveRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + {_excludedRpList = If( json?.PropertyT("excludedRPList"), out var __jsonExcludedRpList) ? If( __jsonExcludedRpList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ExcludedRpList;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + if (null != this._excludedRpList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._excludedRpList ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("excludedRPList",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LogSchedulePolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LogSchedulePolicy.cs new file mode 100644 index 000000000000..34eba044f664 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LogSchedulePolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Log policy schedule. + public partial class LogSchedulePolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILogSchedulePolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILogSchedulePolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy __schedulePolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy(); + + /// Backing field for property. + private int? _scheduleFrequencyInMin; + + /// Frequency of the log schedule operation of this policy in minutes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? ScheduleFrequencyInMin { get => this._scheduleFrequencyInMin; set => this._scheduleFrequencyInMin = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)__schedulePolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)__schedulePolicy).Type = value ; } + + /// Creates an new instance. + public LogSchedulePolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__schedulePolicy), __schedulePolicy); + await eventListener.AssertObjectIsValid(nameof(__schedulePolicy), __schedulePolicy); + } + } + /// Log policy schedule. + public partial interface ILogSchedulePolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy + { + /// Frequency of the log schedule operation of this policy in minutes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Frequency of the log schedule operation of this policy in minutes.", + SerializedName = @"scheduleFrequencyInMins", + PossibleTypes = new [] { typeof(int) })] + int? ScheduleFrequencyInMin { get; set; } + + } + /// Log policy schedule. + internal partial interface ILogSchedulePolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal + { + /// Frequency of the log schedule operation of this policy in minutes. + int? ScheduleFrequencyInMin { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LogSchedulePolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LogSchedulePolicy.json.cs new file mode 100644 index 000000000000..250bf5b92315 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LogSchedulePolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Log policy schedule. + public partial class LogSchedulePolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILogSchedulePolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILogSchedulePolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILogSchedulePolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new LogSchedulePolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal LogSchedulePolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __schedulePolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy(json); + {_scheduleFrequencyInMin = If( json?.PropertyT("scheduleFrequencyInMins"), out var __jsonScheduleFrequencyInMins) ? (int?)__jsonScheduleFrequencyInMins : ScheduleFrequencyInMin;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __schedulePolicy?.ToJson(container, serializationMode); + AddIf( null != this._scheduleFrequencyInMin ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._scheduleFrequencyInMin) : null, "scheduleFrequencyInMins" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermRetentionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermRetentionPolicy.cs new file mode 100644 index 000000000000..61ada293ab47 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermRetentionPolicy.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Long term retention policy. + public partial class LongTermRetentionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy __retentionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionSchedule _dailySchedule; + + /// Daily retention schedule of the protection policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionSchedule DailySchedule { get => (this._dailySchedule = this._dailySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailyRetentionSchedule()); set => this._dailySchedule = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? DailyScheduleRetentionDurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionScheduleInternal)DailySchedule).RetentionDurationCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionScheduleInternal)DailySchedule).RetentionDurationCount = value ?? default(int); } + + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? DailyScheduleRetentionDurationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionScheduleInternal)DailySchedule).RetentionDurationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionScheduleInternal)DailySchedule).RetentionDurationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType)""); } + + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime[] DailyScheduleRetentionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionScheduleInternal)DailySchedule).RetentionTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionScheduleInternal)DailySchedule).RetentionTime = value ?? null /* arrayOf */; } + + /// Internal Acessors for DailySchedule + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionSchedule Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.DailySchedule { get => (this._dailySchedule = this._dailySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailyRetentionSchedule()); set { {_dailySchedule = value;} } } + + /// Internal Acessors for DailyScheduleRetentionDuration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.DailyScheduleRetentionDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionScheduleInternal)DailySchedule).RetentionDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionScheduleInternal)DailySchedule).RetentionDuration = value; } + + /// Internal Acessors for MonthlySchedule + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionSchedule Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.MonthlySchedule { get => (this._monthlySchedule = this._monthlySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MonthlyRetentionSchedule()); set { {_monthlySchedule = value;} } } + + /// Internal Acessors for MonthlyScheduleRetentionDuration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.MonthlyScheduleRetentionDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionDuration = value; } + + /// Internal Acessors for MonthlyScheduleRetentionScheduleDaily + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.MonthlyScheduleRetentionScheduleDaily { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleDaily; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleDaily = value; } + + /// Internal Acessors for MonthlyScheduleRetentionScheduleWeekly + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.MonthlyScheduleRetentionScheduleWeekly { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleWeekly; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleWeekly = value; } + + /// Internal Acessors for WeeklySchedule + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionSchedule Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.WeeklySchedule { get => (this._weeklySchedule = this._weeklySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklyRetentionSchedule()); set { {_weeklySchedule = value;} } } + + /// Internal Acessors for WeeklyScheduleRetentionDuration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.WeeklyScheduleRetentionDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal)WeeklySchedule).RetentionDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal)WeeklySchedule).RetentionDuration = value; } + + /// Internal Acessors for YearlySchedule + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionSchedule Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.YearlySchedule { get => (this._yearlySchedule = this._yearlySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.YearlyRetentionSchedule()); set { {_yearlySchedule = value;} } } + + /// Internal Acessors for YearlyScheduleRetentionDuration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.YearlyScheduleRetentionDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionDuration = value; } + + /// Internal Acessors for YearlyScheduleRetentionScheduleDaily + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.YearlyScheduleRetentionScheduleDaily { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleDaily; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleDaily = value; } + + /// Internal Acessors for YearlyScheduleRetentionScheduleWeekly + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicyInternal.YearlyScheduleRetentionScheduleWeekly { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleWeekly; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleWeekly = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionSchedule _monthlySchedule; + + /// Monthly retention schedule of the protection policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionSchedule MonthlySchedule { get => (this._monthlySchedule = this._monthlySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MonthlyRetentionSchedule()); set => this._monthlySchedule = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? MonthlyScheduleRetentionDurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionDurationCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionDurationCount = value ?? default(int); } + + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? MonthlyScheduleRetentionDurationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionDurationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionDurationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType)""); } + + /// List of days of the month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] MonthlyScheduleRetentionScheduleDailyDaysOfTheMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleDailyDaysOfTheMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleDailyDaysOfTheMonth = value ?? null /* arrayOf */; } + + /// Retention schedule format type for monthly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? MonthlyScheduleRetentionScheduleFormatType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleFormatType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleFormatType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat)""); } + + /// List of days of the week. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] MonthlyScheduleRetentionScheduleWeeklyDaysOfTheWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleWeeklyDaysOfTheWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleWeeklyDaysOfTheWeek = value ?? null /* arrayOf */; } + + /// List of weeks of month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] MonthlyScheduleRetentionScheduleWeeklyWeeksOfTheMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleWeeklyWeeksOfTheMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionScheduleWeeklyWeeksOfTheMonth = value ?? null /* arrayOf */; } + + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime[] MonthlyScheduleRetentionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal)MonthlySchedule).RetentionTime = value ?? null /* arrayOf */; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)__retentionPolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)__retentionPolicy).Type = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionSchedule _weeklySchedule; + + /// Weekly retention schedule of the protection policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionSchedule WeeklySchedule { get => (this._weeklySchedule = this._weeklySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklyRetentionSchedule()); set => this._weeklySchedule = value; } + + /// List of days of week for weekly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] WeeklyScheduleDaysOfTheWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal)WeeklySchedule).DaysOfTheWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal)WeeklySchedule).DaysOfTheWeek = value ?? null /* arrayOf */; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? WeeklyScheduleRetentionDurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal)WeeklySchedule).RetentionDurationCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal)WeeklySchedule).RetentionDurationCount = value ?? default(int); } + + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? WeeklyScheduleRetentionDurationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal)WeeklySchedule).RetentionDurationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal)WeeklySchedule).RetentionDurationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType)""); } + + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime[] WeeklyScheduleRetentionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal)WeeklySchedule).RetentionTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal)WeeklySchedule).RetentionTime = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionSchedule _yearlySchedule; + + /// Yearly retention schedule of the protection policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionSchedule YearlySchedule { get => (this._yearlySchedule = this._yearlySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.YearlyRetentionSchedule()); set => this._yearlySchedule = value; } + + /// List of months of year of yearly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear[] YearlyScheduleMonthsOfYear { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).MonthsOfYear; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).MonthsOfYear = value ?? null /* arrayOf */; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? YearlyScheduleRetentionDurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionDurationCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionDurationCount = value ?? default(int); } + + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? YearlyScheduleRetentionDurationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionDurationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionDurationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType)""); } + + /// List of days of the month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] YearlyScheduleRetentionScheduleDailyDaysOfTheMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleDailyDaysOfTheMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleDailyDaysOfTheMonth = value ?? null /* arrayOf */; } + + /// Retention schedule format for yearly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? YearlyScheduleRetentionScheduleFormatType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleFormatType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleFormatType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat)""); } + + /// List of days of the week. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] YearlyScheduleRetentionScheduleWeeklyDaysOfTheWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleWeeklyDaysOfTheWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleWeeklyDaysOfTheWeek = value ?? null /* arrayOf */; } + + /// List of weeks of month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] YearlyScheduleRetentionScheduleWeeklyWeeksOfTheMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleWeeklyWeeksOfTheMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionScheduleWeeklyWeeksOfTheMonth = value ?? null /* arrayOf */; } + + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime[] YearlyScheduleRetentionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal)YearlySchedule).RetentionTime = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public LongTermRetentionPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__retentionPolicy), __retentionPolicy); + await eventListener.AssertObjectIsValid(nameof(__retentionPolicy), __retentionPolicy); + } + } + /// Long term retention policy. + public partial interface ILongTermRetentionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy + { + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? DailyScheduleRetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type of retention policy.", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? DailyScheduleRetentionDurationType { get; set; } + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention times of retention policy.", + SerializedName = @"retentionTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] DailyScheduleRetentionTime { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? MonthlyScheduleRetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type of retention policy.", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? MonthlyScheduleRetentionDurationType { get; set; } + /// List of days of the month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of the month.", + SerializedName = @"daysOfTheMonth", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] MonthlyScheduleRetentionScheduleDailyDaysOfTheMonth { get; set; } + /// Retention schedule format type for monthly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention schedule format type for monthly retention policy.", + SerializedName = @"retentionScheduleFormatType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? MonthlyScheduleRetentionScheduleFormatType { get; set; } + /// List of days of the week. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of the week.", + SerializedName = @"daysOfTheWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] MonthlyScheduleRetentionScheduleWeeklyDaysOfTheWeek { get; set; } + /// List of weeks of month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of weeks of month.", + SerializedName = @"weeksOfTheMonth", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] MonthlyScheduleRetentionScheduleWeeklyWeeksOfTheMonth { get; set; } + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention times of retention policy.", + SerializedName = @"retentionTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] MonthlyScheduleRetentionTime { get; set; } + /// List of days of week for weekly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of week for weekly retention policy.", + SerializedName = @"daysOfTheWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] WeeklyScheduleDaysOfTheWeek { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? WeeklyScheduleRetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type of retention policy.", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? WeeklyScheduleRetentionDurationType { get; set; } + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention times of retention policy.", + SerializedName = @"retentionTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] WeeklyScheduleRetentionTime { get; set; } + /// List of months of year of yearly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of months of year of yearly retention policy.", + SerializedName = @"monthsOfYear", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear[] YearlyScheduleMonthsOfYear { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? YearlyScheduleRetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type of retention policy.", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? YearlyScheduleRetentionDurationType { get; set; } + /// List of days of the month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of the month.", + SerializedName = @"daysOfTheMonth", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] YearlyScheduleRetentionScheduleDailyDaysOfTheMonth { get; set; } + /// Retention schedule format for yearly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention schedule format for yearly retention policy.", + SerializedName = @"retentionScheduleFormatType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? YearlyScheduleRetentionScheduleFormatType { get; set; } + /// List of days of the week. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of the week.", + SerializedName = @"daysOfTheWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] YearlyScheduleRetentionScheduleWeeklyDaysOfTheWeek { get; set; } + /// List of weeks of month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of weeks of month.", + SerializedName = @"weeksOfTheMonth", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] YearlyScheduleRetentionScheduleWeeklyWeeksOfTheMonth { get; set; } + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention times of retention policy.", + SerializedName = @"retentionTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] YearlyScheduleRetentionTime { get; set; } + + } + /// Long term retention policy. + internal partial interface ILongTermRetentionPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal + { + /// Daily retention schedule of the protection policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionSchedule DailySchedule { get; set; } + /// Retention duration of retention Policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration DailyScheduleRetentionDuration { get; set; } + /// + /// 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. + /// + int? DailyScheduleRetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? DailyScheduleRetentionDurationType { get; set; } + /// Retention times of retention policy. + global::System.DateTime[] DailyScheduleRetentionTime { get; set; } + /// Monthly retention schedule of the protection policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionSchedule MonthlySchedule { get; set; } + /// Retention duration of retention Policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration MonthlyScheduleRetentionDuration { get; set; } + /// + /// 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. + /// + int? MonthlyScheduleRetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? MonthlyScheduleRetentionDurationType { get; set; } + /// Daily retention format for monthly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat MonthlyScheduleRetentionScheduleDaily { get; set; } + /// List of days of the month. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] MonthlyScheduleRetentionScheduleDailyDaysOfTheMonth { get; set; } + /// Retention schedule format type for monthly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? MonthlyScheduleRetentionScheduleFormatType { get; set; } + /// Weekly retention format for monthly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat MonthlyScheduleRetentionScheduleWeekly { get; set; } + /// List of days of the week. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] MonthlyScheduleRetentionScheduleWeeklyDaysOfTheWeek { get; set; } + /// List of weeks of month. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] MonthlyScheduleRetentionScheduleWeeklyWeeksOfTheMonth { get; set; } + /// Retention times of retention policy. + global::System.DateTime[] MonthlyScheduleRetentionTime { get; set; } + /// Weekly retention schedule of the protection policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionSchedule WeeklySchedule { get; set; } + /// List of days of week for weekly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] WeeklyScheduleDaysOfTheWeek { get; set; } + /// Retention duration of retention Policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration WeeklyScheduleRetentionDuration { get; set; } + /// + /// 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. + /// + int? WeeklyScheduleRetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? WeeklyScheduleRetentionDurationType { get; set; } + /// Retention times of retention policy. + global::System.DateTime[] WeeklyScheduleRetentionTime { get; set; } + /// Yearly retention schedule of the protection policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionSchedule YearlySchedule { get; set; } + /// List of months of year of yearly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear[] YearlyScheduleMonthsOfYear { get; set; } + /// Retention duration of retention Policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration YearlyScheduleRetentionDuration { get; set; } + /// + /// 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. + /// + int? YearlyScheduleRetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? YearlyScheduleRetentionDurationType { get; set; } + /// Daily retention format for yearly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat YearlyScheduleRetentionScheduleDaily { get; set; } + /// List of days of the month. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] YearlyScheduleRetentionScheduleDailyDaysOfTheMonth { get; set; } + /// Retention schedule format for yearly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? YearlyScheduleRetentionScheduleFormatType { get; set; } + /// Weekly retention format for yearly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat YearlyScheduleRetentionScheduleWeekly { get; set; } + /// List of days of the week. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] YearlyScheduleRetentionScheduleWeeklyDaysOfTheWeek { get; set; } + /// List of weeks of month. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] YearlyScheduleRetentionScheduleWeeklyWeeksOfTheMonth { get; set; } + /// Retention times of retention policy. + global::System.DateTime[] YearlyScheduleRetentionTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermRetentionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermRetentionPolicy.json.cs new file mode 100644 index 000000000000..6154617a2119 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermRetentionPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Long term retention policy. + public partial class LongTermRetentionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermRetentionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new LongTermRetentionPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal LongTermRetentionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __retentionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy(json); + {_dailySchedule = If( json?.PropertyT("dailySchedule"), out var __jsonDailySchedule) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailyRetentionSchedule.FromJson(__jsonDailySchedule) : DailySchedule;} + {_weeklySchedule = If( json?.PropertyT("weeklySchedule"), out var __jsonWeeklySchedule) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklyRetentionSchedule.FromJson(__jsonWeeklySchedule) : WeeklySchedule;} + {_monthlySchedule = If( json?.PropertyT("monthlySchedule"), out var __jsonMonthlySchedule) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MonthlyRetentionSchedule.FromJson(__jsonMonthlySchedule) : MonthlySchedule;} + {_yearlySchedule = If( json?.PropertyT("yearlySchedule"), out var __jsonYearlySchedule) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.YearlyRetentionSchedule.FromJson(__jsonYearlySchedule) : YearlySchedule;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __retentionPolicy?.ToJson(container, serializationMode); + AddIf( null != this._dailySchedule ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._dailySchedule.ToJson(null,serializationMode) : null, "dailySchedule" ,container.Add ); + AddIf( null != this._weeklySchedule ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._weeklySchedule.ToJson(null,serializationMode) : null, "weeklySchedule" ,container.Add ); + AddIf( null != this._monthlySchedule ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._monthlySchedule.ToJson(null,serializationMode) : null, "monthlySchedule" ,container.Add ); + AddIf( null != this._yearlySchedule ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._yearlySchedule.ToJson(null,serializationMode) : null, "yearlySchedule" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermSchedulePolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermSchedulePolicy.cs new file mode 100644 index 000000000000..bf9e1729fee7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermSchedulePolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Long term policy schedule. + public partial class LongTermSchedulePolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermSchedulePolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermSchedulePolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy __schedulePolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)__schedulePolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)__schedulePolicy).Type = value ; } + + /// Creates an new instance. + public LongTermSchedulePolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__schedulePolicy), __schedulePolicy); + await eventListener.AssertObjectIsValid(nameof(__schedulePolicy), __schedulePolicy); + } + } + /// Long term policy schedule. + public partial interface ILongTermSchedulePolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy + { + + } + /// Long term policy schedule. + internal partial interface ILongTermSchedulePolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermSchedulePolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermSchedulePolicy.json.cs new file mode 100644 index 000000000000..53f23e9a584d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/LongTermSchedulePolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Long term policy schedule. + public partial class LongTermSchedulePolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermSchedulePolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermSchedulePolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ILongTermSchedulePolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new LongTermSchedulePolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal LongTermSchedulePolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __schedulePolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __schedulePolicy?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainer.cs new file mode 100644 index 000000000000..ed7d3c2383a0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainer.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container with items backed up using MAB backup engine. + public partial class MabContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(); + + /// Backing field for property. + private string _agentVersion; + + /// Agent version of this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AgentVersion { get => this._agentVersion; set => this._agentVersion = value; } + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Backing field for property. + private bool? _canReRegister; + + /// Can the container be registered one more time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? CanReRegister { get => this._canReRegister; set => this._canReRegister = value; } + + /// Backing field for property. + private string _containerHealthState; + + /// Health state of mab container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerHealthState { get => this._containerHealthState; set => this._containerHealthState = value; } + + /// Backing field for property. + private long? _containerId; + + /// ContainerID represents the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? ContainerId { get => this._containerId; set => this._containerId = value; } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ContainerType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfo _extendedInfo; + + /// Additional information for this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabContainerExtendedInfo()); set => this._extendedInfo = value; } + + /// List of backup items associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] ExtendedInfoBackupItem { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal)ExtendedInfo).BackupItem; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal)ExtendedInfo).BackupItem = value ?? null /* arrayOf */; } + + /// Type of backup items associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType? ExtendedInfoBackupItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal)ExtendedInfo).BackupItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal)ExtendedInfo).BackupItemType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType)""); } + + /// Latest backup status of this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoLastBackupStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal)ExtendedInfo).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal)ExtendedInfo).LastBackupStatus = value ?? null; } + + /// Time stamp when this container was refreshed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoLastRefreshedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal)ExtendedInfo).LastRefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal)ExtendedInfo).LastRefreshedAt = value ?? default(global::System.DateTime); } + + /// Backup policy associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal)ExtendedInfo).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal)ExtendedInfo).PolicyName = value ?? null; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).FriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetails[] _healthDetail; + + /// Health details on this mab container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetails[] HealthDetail { get => this._healthDetail; set => this._healthDetail = value; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).HealthStatus = value ?? null; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabContainerExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).ProtectableObjectType = value ?? null; } + + /// Backing field for property. + private long? _protectedItemCount; + + /// Number of items backed up in this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? ProtectedItemCount { get => this._protectedItemCount; set => this._protectedItemCount = value; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)__protectionContainer).RegistrationStatus = value ?? null; } + + /// Creates an new instance. + public MabContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionContainer), __protectionContainer); + await eventListener.AssertObjectIsValid(nameof(__protectionContainer), __protectionContainer); + } + } + /// Container with items backed up using MAB backup engine. + public partial interface IMabContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer + { + /// Agent version of this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Agent version of this container.", + SerializedName = @"agentVersion", + PossibleTypes = new [] { typeof(string) })] + string AgentVersion { get; set; } + /// Can the container be registered one more time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can the container be registered one more time.", + SerializedName = @"canReRegister", + PossibleTypes = new [] { typeof(bool) })] + bool? CanReRegister { get; set; } + /// Health state of mab container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health state of mab container.", + SerializedName = @"containerHealthState", + PossibleTypes = new [] { typeof(string) })] + string ContainerHealthState { get; set; } + /// ContainerID represents the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ContainerID represents the container.", + SerializedName = @"containerId", + PossibleTypes = new [] { typeof(long) })] + long? ContainerId { get; set; } + /// List of backup items associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of backup items associated with this container.", + SerializedName = @"backupItems", + PossibleTypes = new [] { typeof(string) })] + string[] ExtendedInfoBackupItem { get; set; } + /// Type of backup items associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup items associated with this container.", + SerializedName = @"backupItemType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType? ExtendedInfoBackupItemType { get; set; } + /// Latest backup status of this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Latest backup status of this container.", + SerializedName = @"lastBackupStatus", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoLastBackupStatus { get; set; } + /// Time stamp when this container was refreshed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time stamp when this container was refreshed.", + SerializedName = @"lastRefreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoLastRefreshedAt { get; set; } + /// Backup policy associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup policy associated with this container.", + SerializedName = @"policyName", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoPolicyName { get; set; } + /// Health details on this mab container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health details on this mab container.", + SerializedName = @"mabContainerHealthDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetails[] HealthDetail { get; set; } + /// Number of items backed up in this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of items backed up in this container.", + SerializedName = @"protectedItemCount", + PossibleTypes = new [] { typeof(long) })] + long? ProtectedItemCount { get; set; } + + } + /// Container with items backed up using MAB backup engine. + internal partial interface IMabContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal + { + /// Agent version of this container. + string AgentVersion { get; set; } + /// Can the container be registered one more time. + bool? CanReRegister { get; set; } + /// Health state of mab container. + string ContainerHealthState { get; set; } + /// ContainerID represents the container. + long? ContainerId { get; set; } + /// Additional information for this container + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfo ExtendedInfo { get; set; } + /// List of backup items associated with this container. + string[] ExtendedInfoBackupItem { get; set; } + /// Type of backup items associated with this container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType? ExtendedInfoBackupItemType { get; set; } + /// Latest backup status of this container. + string ExtendedInfoLastBackupStatus { get; set; } + /// Time stamp when this container was refreshed. + global::System.DateTime? ExtendedInfoLastRefreshedAt { get; set; } + /// Backup policy associated with this container. + string ExtendedInfoPolicyName { get; set; } + /// Health details on this mab container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetails[] HealthDetail { get; set; } + /// Number of items backed up in this container. + long? ProtectedItemCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainer.json.cs new file mode 100644 index 000000000000..4810396d54e9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Container with items backed up using MAB backup engine. + public partial class MabContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabContainer(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MabContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionContainer = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabContainerExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_canReRegister = If( json?.PropertyT("canReRegister"), out var __jsonCanReRegister) ? (bool?)__jsonCanReRegister : CanReRegister;} + {_containerId = If( json?.PropertyT("containerId"), out var __jsonContainerId) ? (long?)__jsonContainerId : ContainerId;} + {_protectedItemCount = If( json?.PropertyT("protectedItemCount"), out var __jsonProtectedItemCount) ? (long?)__jsonProtectedItemCount : ProtectedItemCount;} + {_agentVersion = If( json?.PropertyT("agentVersion"), out var __jsonAgentVersion) ? (string)__jsonAgentVersion : (string)AgentVersion;} + {_healthDetail = If( json?.PropertyT("mabContainerHealthDetails"), out var __jsonMabContainerHealthDetails) ? If( __jsonMabContainerHealthDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabContainerHealthDetails.FromJson(__u) )) ))() : null : HealthDetail;} + {_containerHealthState = If( json?.PropertyT("containerHealthState"), out var __jsonContainerHealthState) ? (string)__jsonContainerHealthState : (string)ContainerHealthState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionContainer?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != this._canReRegister ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._canReRegister) : null, "canReRegister" ,container.Add ); + AddIf( null != this._containerId ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._containerId) : null, "containerId" ,container.Add ); + AddIf( null != this._protectedItemCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._protectedItemCount) : null, "protectedItemCount" ,container.Add ); + AddIf( null != (((object)this._agentVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._agentVersion.ToString()) : null, "agentVersion" ,container.Add ); + if (null != this._healthDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._healthDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("mabContainerHealthDetails",__w); + } + AddIf( null != (((object)this._containerHealthState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerHealthState.ToString()) : null, "containerHealthState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerExtendedInfo.cs new file mode 100644 index 000000000000..ee5101d3a069 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information of the container. + public partial class MabContainerExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfoInternal + { + + /// Backing field for property. + private string[] _backupItem; + + /// List of backup items associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] BackupItem { get => this._backupItem; set => this._backupItem = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType? _backupItemType; + + /// Type of backup items associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType? BackupItemType { get => this._backupItemType; set => this._backupItemType = value; } + + /// Backing field for property. + private string _lastBackupStatus; + + /// Latest backup status of this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string LastBackupStatus { get => this._lastBackupStatus; set => this._lastBackupStatus = value; } + + /// Backing field for property. + private global::System.DateTime? _lastRefreshedAt; + + /// Time stamp when this container was refreshed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? LastRefreshedAt { get => this._lastRefreshedAt; set => this._lastRefreshedAt = value; } + + /// Backing field for property. + private string _policyName; + + /// Backup policy associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyName { get => this._policyName; set => this._policyName = value; } + + /// Creates an new instance. + public MabContainerExtendedInfo() + { + + } + } + /// Additional information of the container. + public partial interface IMabContainerExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of backup items associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of backup items associated with this container.", + SerializedName = @"backupItems", + PossibleTypes = new [] { typeof(string) })] + string[] BackupItem { get; set; } + /// Type of backup items associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup items associated with this container.", + SerializedName = @"backupItemType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType? BackupItemType { get; set; } + /// Latest backup status of this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Latest backup status of this container.", + SerializedName = @"lastBackupStatus", + PossibleTypes = new [] { typeof(string) })] + string LastBackupStatus { get; set; } + /// Time stamp when this container was refreshed. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time stamp when this container was refreshed.", + SerializedName = @"lastRefreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRefreshedAt { get; set; } + /// Backup policy associated with this container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup policy associated with this container.", + SerializedName = @"policyName", + PossibleTypes = new [] { typeof(string) })] + string PolicyName { get; set; } + + } + /// Additional information of the container. + internal partial interface IMabContainerExtendedInfoInternal + + { + /// List of backup items associated with this container. + string[] BackupItem { get; set; } + /// Type of backup items associated with this container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType? BackupItemType { get; set; } + /// Latest backup status of this container. + string LastBackupStatus { get; set; } + /// Time stamp when this container was refreshed. + global::System.DateTime? LastRefreshedAt { get; set; } + /// Backup policy associated with this container. + string PolicyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerExtendedInfo.json.cs new file mode 100644 index 000000000000..4b7fe59f9c4d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information of the container. + public partial class MabContainerExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabContainerExtendedInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MabContainerExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_lastRefreshedAt = If( json?.PropertyT("lastRefreshedAt"), out var __jsonLastRefreshedAt) ? global::System.DateTime.TryParse((string)__jsonLastRefreshedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastRefreshedAtValue) ? __jsonLastRefreshedAtValue : LastRefreshedAt : LastRefreshedAt;} + {_backupItemType = If( json?.PropertyT("backupItemType"), out var __jsonBackupItemType) ? (string)__jsonBackupItemType : (string)BackupItemType;} + {_backupItem = If( json?.PropertyT("backupItems"), out var __jsonBackupItems) ? If( __jsonBackupItems as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : BackupItem;} + {_policyName = If( json?.PropertyT("policyName"), out var __jsonPolicyName) ? (string)__jsonPolicyName : (string)PolicyName;} + {_lastBackupStatus = If( json?.PropertyT("lastBackupStatus"), out var __jsonLastBackupStatus) ? (string)__jsonLastBackupStatus : (string)LastBackupStatus;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._lastRefreshedAt ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastRefreshedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastRefreshedAt" ,container.Add ); + AddIf( null != (((object)this._backupItemType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupItemType.ToString()) : null, "backupItemType" ,container.Add ); + if (null != this._backupItem) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._backupItem ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("backupItems",__w); + } + AddIf( null != (((object)this._policyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyName.ToString()) : null, "policyName" ,container.Add ); + AddIf( null != (((object)this._lastBackupStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastBackupStatus.ToString()) : null, "lastBackupStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerHealthDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerHealthDetails.cs new file mode 100644 index 000000000000..0f743f395326 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerHealthDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific Health Details. + public partial class MabContainerHealthDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetailsInternal + { + + /// Backing field for property. + private int? _code; + + /// Health Code + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + /// Health Message + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private string[] _recommendation; + + /// Health Recommended Actions + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; set => this._recommendation = value; } + + /// Backing field for property. + private string _title; + + /// Health Title + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// Creates an new instance. + public MabContainerHealthDetails() + { + + } + } + /// MAB workload-specific Health Details. + public partial interface IMabContainerHealthDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Health Code + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health Code", + SerializedName = @"code", + PossibleTypes = new [] { typeof(int) })] + int? Code { get; set; } + /// Health Message + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health Message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Health Recommended Actions + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health Recommended Actions", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; set; } + /// Health Title + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health Title", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// MAB workload-specific Health Details. + internal partial interface IMabContainerHealthDetailsInternal + + { + /// Health Code + int? Code { get; set; } + /// Health Message + string Message { get; set; } + /// Health Recommended Actions + string[] Recommendation { get; set; } + /// Health Title + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerHealthDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerHealthDetails.json.cs new file mode 100644 index 000000000000..d3a1beecad1d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabContainerHealthDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific Health Details. + public partial class MabContainerHealthDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabContainerHealthDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabContainerHealthDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MabContainerHealthDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (int?)__jsonCode : Code;} + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_recommendation = If( json?.PropertyT("recommendations"), out var __jsonRecommendations) ? If( __jsonRecommendations as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Recommendation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._code ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._code) : null, "code" ,container.Add ); + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabErrorInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabErrorInfo.cs new file mode 100644 index 000000000000..676543be62ec --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabErrorInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific error information. + public partial class MabErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfoInternal + { + + /// Backing field for property. + private string _errorString; + + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorString { get => this._errorString; } + + /// Internal Acessors for ErrorString + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfoInternal.ErrorString { get => this._errorString; set { {_errorString = value;} } } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfoInternal.Recommendation { get => this._recommendation; set { {_recommendation = value;} } } + + /// Backing field for property. + private string[] _recommendation; + + /// List of localized recommendations. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; } + + /// Creates an new instance. + public MabErrorInfo() + { + + } + } + /// MAB workload-specific error information. + public partial interface IMabErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Localized error string.", + SerializedName = @"errorString", + PossibleTypes = new [] { typeof(string) })] + string ErrorString { get; } + /// List of localized recommendations. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of localized recommendations.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; } + + } + /// MAB workload-specific error information. + internal partial interface IMabErrorInfoInternal + + { + /// Localized error string. + string ErrorString { get; set; } + /// List of localized recommendations. + string[] Recommendation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabErrorInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabErrorInfo.json.cs new file mode 100644 index 000000000000..197a898da4da --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabErrorInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific error information. + public partial class MabErrorInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabErrorInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MabErrorInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorString = If( json?.PropertyT("errorString"), out var __jsonErrorString) ? (string)__jsonErrorString : (string)ErrorString;} + {_recommendation = If( json?.PropertyT("recommendations"), out var __jsonRecommendations) ? If( __jsonRecommendations as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Recommendation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorString.ToString()) : null, "errorString" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItem.cs new file mode 100644 index 000000000000..0c3730e4ffbf --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific backup item. + public partial class MabFileFolderProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).BackupSetName = value ?? null; } + + /// Backing field for property. + private string _computerName; + + /// Name of the computer associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ComputerName { get => this._computerName; set => this._computerName = value; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Backing field for property. + private long? _deferredDeleteSyncTimeInUtc; + + /// Sync time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? DeferredDeleteSyncTimeInUtc { get => this._deferredDeleteSyncTimeInUtc; set => this._deferredDeleteSyncTimeInUtc = value; } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfo _extendedInfo; + + /// Additional information with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabFileFolderProtectedItemExtendedInfo()); set => this._extendedInfo = value; } + + /// Last time when the agent data synced to service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoLastRefreshedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfoInternal)ExtendedInfo).LastRefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfoInternal)ExtendedInfo).LastRefreshedAt = value ?? default(global::System.DateTime); } + + /// The oldest backup copy available. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Number of backup copies associated with the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ExtendedInfoRecoveryPointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount = value ?? default(int); } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Backing field for property. + private string _lastBackupStatus; + + /// Status of last backup operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string LastBackupStatus { get => this._lastBackupStatus; set => this._lastBackupStatus = value; } + + /// Backing field for property. + private global::System.DateTime? _lastBackupTime; + + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? LastBackupTime { get => this._lastBackupTime; set => this._lastBackupTime = value; } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabFileFolderProtectedItemExtendedInfo()); set { {_extendedInfo = value;} } } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).PolicyName = value ?? null; } + + /// Backing field for property. + private string _protectionState; + + /// Protected, ProtectionStopped, IRPending or ProtectionError + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectionState { get => this._protectionState; set => this._protectionState = value; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).SourceResourceId = value ?? null; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).Type = value ; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)__protectedItem).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public MabFileFolderProtectedItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectedItem), __protectedItem); + await eventListener.AssertObjectIsValid(nameof(__protectedItem), __protectedItem); + } + } + /// MAB workload-specific backup item. + public partial interface IMabFileFolderProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem + { + /// Name of the computer associated with this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the computer associated with this backup item.", + SerializedName = @"computerName", + PossibleTypes = new [] { typeof(string) })] + string ComputerName { get; set; } + /// Sync time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sync time for deferred deletion in UTC", + SerializedName = @"deferredDeleteSyncTimeInUTC", + PossibleTypes = new [] { typeof(long) })] + long? DeferredDeleteSyncTimeInUtc { get; set; } + /// Last time when the agent data synced to service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last time when the agent data synced to service.", + SerializedName = @"lastRefreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoLastRefreshedAt { get; set; } + /// The oldest backup copy available. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// Number of backup copies associated with the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of backup copies associated with the backup item.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? ExtendedInfoRecoveryPointCount { get; set; } + /// Friendly name of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of this backup item.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Status of last backup operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of last backup operation.", + SerializedName = @"lastBackupStatus", + PossibleTypes = new [] { typeof(string) })] + string LastBackupStatus { get; set; } + /// Timestamp of the last backup operation on this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Timestamp of the last backup operation on this backup item.", + SerializedName = @"lastBackupTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastBackupTime { get; set; } + /// Protected, ProtectionStopped, IRPending or ProtectionError + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protected, ProtectionStopped, IRPending or ProtectionError", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(string) })] + string ProtectionState { get; set; } + + } + /// MAB workload-specific backup item. + internal partial interface IMabFileFolderProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal + { + /// Name of the computer associated with this backup item. + string ComputerName { get; set; } + /// Sync time for deferred deletion in UTC + long? DeferredDeleteSyncTimeInUtc { get; set; } + /// Additional information with this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfo ExtendedInfo { get; set; } + /// Last time when the agent data synced to service. + global::System.DateTime? ExtendedInfoLastRefreshedAt { get; set; } + /// The oldest backup copy available. + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// Number of backup copies associated with the backup item. + int? ExtendedInfoRecoveryPointCount { get; set; } + /// Friendly name of this backup item. + string FriendlyName { get; set; } + /// Status of last backup operation. + string LastBackupStatus { get; set; } + /// Timestamp of the last backup operation on this backup item. + global::System.DateTime? LastBackupTime { get; set; } + /// Protected, ProtectionStopped, IRPending or ProtectionError + string ProtectionState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItem.json.cs new file mode 100644 index 000000000000..40bcb83d2de3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific backup item. + public partial class MabFileFolderProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabFileFolderProtectedItem(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MabFileFolderProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabFileFolderProtectedItemExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_computerName = If( json?.PropertyT("computerName"), out var __jsonComputerName) ? (string)__jsonComputerName : (string)ComputerName;} + {_lastBackupStatus = If( json?.PropertyT("lastBackupStatus"), out var __jsonLastBackupStatus) ? (string)__jsonLastBackupStatus : (string)LastBackupStatus;} + {_lastBackupTime = If( json?.PropertyT("lastBackupTime"), out var __jsonLastBackupTime) ? global::System.DateTime.TryParse((string)__jsonLastBackupTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastBackupTimeValue) ? __jsonLastBackupTimeValue : LastBackupTime : LastBackupTime;} + {_protectionState = If( json?.PropertyT("protectionState"), out var __jsonProtectionState) ? (string)__jsonProtectionState : (string)ProtectionState;} + {_deferredDeleteSyncTimeInUtc = If( json?.PropertyT("deferredDeleteSyncTimeInUTC"), out var __jsonDeferredDeleteSyncTimeInUtc) ? (long?)__jsonDeferredDeleteSyncTimeInUtc : DeferredDeleteSyncTimeInUtc;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectedItem?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._computerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._computerName.ToString()) : null, "computerName" ,container.Add ); + AddIf( null != (((object)this._lastBackupStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastBackupStatus.ToString()) : null, "lastBackupStatus" ,container.Add ); + AddIf( null != this._lastBackupTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastBackupTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastBackupTime" ,container.Add ); + AddIf( null != (((object)this._protectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionState.ToString()) : null, "protectionState" ,container.Add ); + AddIf( null != this._deferredDeleteSyncTimeInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._deferredDeleteSyncTimeInUtc) : null, "deferredDeleteSyncTimeInUTC" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..9eadd3956b99 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItemExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on the backed up item. + public partial class MabFileFolderProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfoInternal + { + + /// Backing field for property. + private global::System.DateTime? _lastRefreshedAt; + + /// Last time when the agent data synced to service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? LastRefreshedAt { get => this._lastRefreshedAt; set => this._lastRefreshedAt = value; } + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPoint; + + /// The oldest backup copy available. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? OldestRecoveryPoint { get => this._oldestRecoveryPoint; set => this._oldestRecoveryPoint = value; } + + /// Backing field for property. + private int? _recoveryPointCount; + + /// Number of backup copies associated with the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? RecoveryPointCount { get => this._recoveryPointCount; set => this._recoveryPointCount = value; } + + /// Creates an new instance. + public MabFileFolderProtectedItemExtendedInfo() + { + + } + } + /// Additional information on the backed up item. + public partial interface IMabFileFolderProtectedItemExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Last time when the agent data synced to service. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last time when the agent data synced to service.", + SerializedName = @"lastRefreshedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRefreshedAt { get; set; } + /// The oldest backup copy available. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// Number of backup copies associated with the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of backup copies associated with the backup item.", + SerializedName = @"recoveryPointCount", + PossibleTypes = new [] { typeof(int) })] + int? RecoveryPointCount { get; set; } + + } + /// Additional information on the backed up item. + internal partial interface IMabFileFolderProtectedItemExtendedInfoInternal + + { + /// Last time when the agent data synced to service. + global::System.DateTime? LastRefreshedAt { get; set; } + /// The oldest backup copy available. + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// Number of backup copies associated with the backup item. + int? RecoveryPointCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..96b15daa029b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabFileFolderProtectedItemExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information on the backed up item. + public partial class MabFileFolderProtectedItemExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabFileFolderProtectedItemExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabFileFolderProtectedItemExtendedInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MabFileFolderProtectedItemExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_lastRefreshedAt = If( json?.PropertyT("lastRefreshedAt"), out var __jsonLastRefreshedAt) ? global::System.DateTime.TryParse((string)__jsonLastRefreshedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastRefreshedAtValue) ? __jsonLastRefreshedAtValue : LastRefreshedAt : LastRefreshedAt;} + {_oldestRecoveryPoint = If( json?.PropertyT("oldestRecoveryPoint"), out var __jsonOldestRecoveryPoint) ? global::System.DateTime.TryParse((string)__jsonOldestRecoveryPoint, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOldestRecoveryPointValue) ? __jsonOldestRecoveryPointValue : OldestRecoveryPoint : OldestRecoveryPoint;} + {_recoveryPointCount = If( json?.PropertyT("recoveryPointCount"), out var __jsonRecoveryPointCount) ? (int?)__jsonRecoveryPointCount : RecoveryPointCount;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._lastRefreshedAt ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastRefreshedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastRefreshedAt" ,container.Add ); + AddIf( null != this._oldestRecoveryPoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._oldestRecoveryPoint?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "oldestRecoveryPoint" ,container.Add ); + AddIf( null != this._recoveryPointCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._recoveryPointCount) : null, "recoveryPointCount" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJob.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJob.cs new file mode 100644 index 000000000000..5cb9ceed8499 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJob.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific job. + public partial class MabJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] _actionsInfo; + + /// The state/actions applicable on jobs like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get => this._actionsInfo; set => this._actionsInfo = value; } + + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ActivityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId = value ?? null; } + + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Backing field for property. + private global::System.TimeSpan? _duration; + + /// Time taken by job to run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.TimeSpan? Duration { get => this._duration; set => this._duration = value; } + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? EndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime = value ?? default(global::System.DateTime); } + + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EntityFriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfo[] _errorDetail; + + /// The errors. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfo _extendedInfo; + + /// Additional information on the job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabJobExtendedInfo()); set => this._extendedInfo = value; } + + /// Non localized error message specific to this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ExtendedInfoDynamicErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage = value ?? null; } + + /// The job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoInternal)ExtendedInfo).PropertyBag = value ?? null /* model class */; } + + /// List of tasks for this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoInternal)ExtendedInfo).TasksList = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _mabServerName; + + /// Name of server protecting the DS. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string MabServerName { get => this._mabServerName; set => this._mabServerName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType? _mabServerType; + + /// Server type of MAB container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType? MabServerType { get => this._mabServerType; set => this._mabServerType = value; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabJobExtendedInfo()); set { {_extendedInfo = value;} } } + + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Operation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation = value ?? null; } + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime = value ?? default(global::System.DateTime); } + + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status = value ?? null; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? _workloadType; + + /// Workload type of backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public MabJob() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__job), __job); + await eventListener.AssertObjectIsValid(nameof(__job), __job); + } + } + /// MAB workload-specific job. + public partial interface IMabJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob + { + /// The state/actions applicable on jobs like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The state/actions applicable on jobs like cancel/retry.", + SerializedName = @"actionsInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Time taken by job to run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time taken by job to run.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Duration { get; set; } + /// The errors. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The errors.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfo[] ErrorDetail { get; set; } + /// Non localized error message specific to this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message specific to this job.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string ExtendedInfoDynamicErrorMessage { get; set; } + /// The job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks for this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks for this job.", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Name of server protecting the DS. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of server protecting the DS.", + SerializedName = @"mabServerName", + PossibleTypes = new [] { typeof(string) })] + string MabServerName { get; set; } + /// Server type of MAB container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server type of MAB container.", + SerializedName = @"mabServerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType? MabServerType { get; set; } + /// Workload type of backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload type of backup item.", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } + /// MAB workload-specific job. + internal partial interface IMabJobInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal + { + /// The state/actions applicable on jobs like cancel/retry. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Time taken by job to run. + global::System.TimeSpan? Duration { get; set; } + /// The errors. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfo[] ErrorDetail { get; set; } + /// Additional information on the job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfo ExtendedInfo { get; set; } + /// Non localized error message specific to this job. + string ExtendedInfoDynamicErrorMessage { get; set; } + /// The job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks for this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Name of server protecting the DS. + string MabServerName { get; set; } + /// Server type of MAB container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType? MabServerType { get; set; } + /// Workload type of backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJob.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJob.json.cs new file mode 100644 index 000000000000..3029bb79ccc9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJob.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific job. + public partial class MabJob + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJob FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabJob(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MabJob(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabJobExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonDuration ) : Duration;} + {_actionsInfo = If( json?.PropertyT("actionsInfo"), out var __jsonActionsInfo) ? If( __jsonActionsInfo as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)""))) ))() : null : ActionsInfo;} + {_mabServerName = If( json?.PropertyT("mabServerName"), out var __jsonMabServerName) ? (string)__jsonMabServerName : (string)MabServerName;} + {_mabServerType = If( json?.PropertyT("mabServerType"), out var __jsonMabServerType) ? (string)__jsonMabServerType : (string)MabServerType;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + {_errorDetail = If( json?.PropertyT("errorDetails"), out var __jsonErrorDetails) ? If( __jsonErrorDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabErrorInfo.FromJson(__p) )) ))() : null : ErrorDetail;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __job?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)(null != this._duration ? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._duration)): null), "duration" ,container.Add ); + if (null != this._actionsInfo) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._actionsInfo ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("actionsInfo",__w); + } + AddIf( null != (((object)this._mabServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._mabServerName.ToString()) : null, "mabServerName" ,container.Add ); + AddIf( null != (((object)this._mabServerType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._mabServerType.ToString()) : null, "mabServerType" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + if (null != this._errorDetail) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._errorDetail ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("errorDetails",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfo.cs new file mode 100644 index 000000000000..f8a902b05cdb --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information for the MAB workload-specific job. + public partial class MabJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoInternal + { + + /// Backing field for property. + private string _dynamicErrorMessage; + + /// Non localized error message specific to this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DynamicErrorMessage { get => this._dynamicErrorMessage; set => this._dynamicErrorMessage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag _propertyBag; + + /// The job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails[] _tasksList; + + /// List of tasks for this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails[] TasksList { get => this._tasksList; set => this._tasksList = value; } + + /// Creates an new instance. + public MabJobExtendedInfo() + { + + } + } + /// Additional information for the MAB workload-specific job. + public partial interface IMabJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Non localized error message specific to this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Non localized error message specific to this job.", + SerializedName = @"dynamicErrorMessage", + PossibleTypes = new [] { typeof(string) })] + string DynamicErrorMessage { get; set; } + /// The job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks for this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of tasks for this job.", + SerializedName = @"tasksList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails[] TasksList { get; set; } + + } + /// Additional information for the MAB workload-specific job. + internal partial interface IMabJobExtendedInfoInternal + + { + /// Non localized error message specific to this job. + string DynamicErrorMessage { get; set; } + /// The job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks for this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails[] TasksList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfo.json.cs new file mode 100644 index 000000000000..18d034daa872 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Additional information for the MAB workload-specific job. + public partial class MabJobExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabJobExtendedInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MabJobExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tasksList = If( json?.PropertyT("tasksList"), out var __jsonTasksList) ? If( __jsonTasksList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabJobTaskDetails.FromJson(__u) )) ))() : null : TasksList;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabJobExtendedInfoPropertyBag.FromJson(__jsonPropertyBag) : PropertyBag;} + {_dynamicErrorMessage = If( json?.PropertyT("dynamicErrorMessage"), out var __jsonDynamicErrorMessage) ? (string)__jsonDynamicErrorMessage : (string)DynamicErrorMessage;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._tasksList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._tasksList ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("tasksList",__w); + } + AddIf( null != this._propertyBag ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._propertyBag.ToJson(null,serializationMode) : null, "propertyBag" ,container.Add ); + AddIf( null != (((object)this._dynamicErrorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dynamicErrorMessage.ToString()) : null, "dynamicErrorMessage" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..5a7b4b98986d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The job properties. + public partial class MabJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBagInternal + { + + /// Creates an new instance. + public MabJobExtendedInfoPropertyBag() + { + + } + } + /// The job properties. + public partial interface IMabJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// The job properties. + internal partial interface IMabJobExtendedInfoPropertyBagInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..e37fe89a2770 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class MabJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.MabJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..1abf3e490adf --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobExtendedInfoPropertyBag.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The job properties. + public partial class MabJobExtendedInfoPropertyBag + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobExtendedInfoPropertyBag FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabJobExtendedInfoPropertyBag(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MabJobExtendedInfoPropertyBag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobTaskDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobTaskDetails.cs new file mode 100644 index 000000000000..9a806fdc9c66 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobTaskDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific job task details. + public partial class MabJobTaskDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetailsInternal + { + + /// Backing field for property. + private global::System.TimeSpan? _duration; + + /// Time elapsed for task. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.TimeSpan? Duration { get => this._duration; set => this._duration = value; } + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private string _status; + + /// The status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string _taskId; + + /// The task display name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TaskId { get => this._taskId; set => this._taskId = value; } + + /// Creates an new instance. + public MabJobTaskDetails() + { + + } + } + /// MAB workload-specific job task details. + public partial interface IMabJobTaskDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Time elapsed for task. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time elapsed for task.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Duration { get; set; } + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end time.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// The status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + /// The task display name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The task display name.", + SerializedName = @"taskId", + PossibleTypes = new [] { typeof(string) })] + string TaskId { get; set; } + + } + /// MAB workload-specific job task details. + internal partial interface IMabJobTaskDetailsInternal + + { + /// Time elapsed for task. + global::System.TimeSpan? Duration { get; set; } + /// The end time. + global::System.DateTime? EndTime { get; set; } + /// The start time. + global::System.DateTime? StartTime { get; set; } + /// The status. + string Status { get; set; } + /// The task display name. + string TaskId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobTaskDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobTaskDetails.json.cs new file mode 100644 index 000000000000..8f5fe6ad7c76 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabJobTaskDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific job task details. + public partial class MabJobTaskDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabJobTaskDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabJobTaskDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MabJobTaskDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_taskId = If( json?.PropertyT("taskId"), out var __jsonTaskId) ? (string)__jsonTaskId : (string)TaskId;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonDuration ) : Duration;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._taskId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._taskId.ToString()) : null, "taskId" ,container.Add ); + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)(null != this._duration ? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._duration)): null), "duration" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabProtectionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabProtectionPolicy.cs new file mode 100644 index 000000000000..c46ff09768ef --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabProtectionPolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Mab container-specific backup policy. + public partial class MabProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabProtectionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabProtectionPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).BackupManagementType = value ; } + + /// Internal Acessors for RetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabProtectionPolicyInternal.RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy()); set { {_retentionPolicy = value;} } } + + /// Internal Acessors for SchedulePolicy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabProtectionPolicyInternal.SchedulePolicy { get => (this._schedulePolicy = this._schedulePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy()); set { {_schedulePolicy = value;} } } + + /// Number of items associated with this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public int? ProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ProtectedItemsCount = value ?? default(int); } + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)__protectionPolicy).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy _retentionPolicy; + + /// Retention policy details. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy()); set => this._retentionPolicy = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RetentionPolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)RetentionPolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)RetentionPolicy).Type = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy _schedulePolicy; + + /// Backup schedule of backup policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy SchedulePolicy { get => (this._schedulePolicy = this._schedulePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy()); set => this._schedulePolicy = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string SchedulePolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)SchedulePolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)SchedulePolicy).Type = value ?? null; } + + /// Creates an new instance. + public MabProtectionPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__protectionPolicy), __protectionPolicy); + await eventListener.AssertObjectIsValid(nameof(__protectionPolicy), __protectionPolicy); + } + } + /// Mab container-specific backup policy. + public partial interface IMabProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"retentionPolicyType", + PossibleTypes = new [] { typeof(string) })] + string RetentionPolicyType { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"schedulePolicyType", + PossibleTypes = new [] { typeof(string) })] + string SchedulePolicyType { get; set; } + + } + /// Mab container-specific backup policy. + internal partial interface IMabProtectionPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal + { + /// Retention policy details. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy RetentionPolicy { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string RetentionPolicyType { get; set; } + /// Backup schedule of backup policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy SchedulePolicy { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string SchedulePolicyType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabProtectionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabProtectionPolicy.json.cs new file mode 100644 index 000000000000..36d3257dcb6b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MabProtectionPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Mab container-specific backup policy. + public partial class MabProtectionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabProtectionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabProtectionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMabProtectionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MabProtectionPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MabProtectionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __protectionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy(json); + {_schedulePolicy = If( json?.PropertyT("schedulePolicy"), out var __jsonSchedulePolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy.FromJson(__jsonSchedulePolicy) : SchedulePolicy;} + {_retentionPolicy = If( json?.PropertyT("retentionPolicy"), out var __jsonRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy.FromJson(__jsonRetentionPolicy) : RetentionPolicy;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __protectionPolicy?.ToJson(container, serializationMode); + AddIf( null != this._schedulePolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._schedulePolicy.ToJson(null,serializationMode) : null, "schedulePolicy" ,container.Add ); + AddIf( null != this._retentionPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionPolicy.ToJson(null,serializationMode) : null, "retentionPolicy" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MonthlyRetentionSchedule.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MonthlyRetentionSchedule.cs new file mode 100644 index 000000000000..0249724b1a4e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MonthlyRetentionSchedule.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Monthly retention schedule. + public partial class MonthlyRetentionSchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionSchedule, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal + { + + /// Internal Acessors for RetentionDuration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal.RetentionDuration { get => (this._retentionDuration = this._retentionDuration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration()); set { {_retentionDuration = value;} } } + + /// Internal Acessors for RetentionScheduleDaily + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal.RetentionScheduleDaily { get => (this._retentionScheduleDaily = this._retentionScheduleDaily ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailyRetentionFormat()); set { {_retentionScheduleDaily = value;} } } + + /// Internal Acessors for RetentionScheduleWeekly + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionScheduleInternal.RetentionScheduleWeekly { get => (this._retentionScheduleWeekly = this._retentionScheduleWeekly ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklyRetentionFormat()); set { {_retentionScheduleWeekly = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration _retentionDuration; + + /// Retention duration of retention Policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration RetentionDuration { get => (this._retentionDuration = this._retentionDuration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration()); set => this._retentionDuration = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? RetentionDurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).Count = value ?? default(int); } + + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).DurationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).DurationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat _retentionScheduleDaily; + + /// Daily retention format for monthly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat RetentionScheduleDaily { get => (this._retentionScheduleDaily = this._retentionScheduleDaily ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailyRetentionFormat()); set => this._retentionScheduleDaily = value; } + + /// List of days of the month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] RetentionScheduleDailyDaysOfTheMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormatInternal)RetentionScheduleDaily).DaysOfTheMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormatInternal)RetentionScheduleDaily).DaysOfTheMonth = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? _retentionScheduleFormatType; + + /// Retention schedule format type for monthly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? RetentionScheduleFormatType { get => this._retentionScheduleFormatType; set => this._retentionScheduleFormatType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat _retentionScheduleWeekly; + + /// Weekly retention format for monthly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat RetentionScheduleWeekly { get => (this._retentionScheduleWeekly = this._retentionScheduleWeekly ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklyRetentionFormat()); set => this._retentionScheduleWeekly = value; } + + /// List of days of the week. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] RetentionScheduleWeeklyDaysOfTheWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormatInternal)RetentionScheduleWeekly).DaysOfTheWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormatInternal)RetentionScheduleWeekly).DaysOfTheWeek = value ?? null /* arrayOf */; } + + /// List of weeks of month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] RetentionScheduleWeeklyWeeksOfTheMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormatInternal)RetentionScheduleWeekly).WeeksOfTheMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormatInternal)RetentionScheduleWeekly).WeeksOfTheMonth = value ?? null /* arrayOf */; } + + /// Backing field for property. + private global::System.DateTime[] _retentionTime; + + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime[] RetentionTime { get => this._retentionTime; set => this._retentionTime = value; } + + /// Creates an new instance. + public MonthlyRetentionSchedule() + { + + } + } + /// Monthly retention schedule. + public partial interface IMonthlyRetentionSchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? RetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type of retention policy.", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get; set; } + /// List of days of the month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of the month.", + SerializedName = @"daysOfTheMonth", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] RetentionScheduleDailyDaysOfTheMonth { get; set; } + /// Retention schedule format type for monthly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention schedule format type for monthly retention policy.", + SerializedName = @"retentionScheduleFormatType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? RetentionScheduleFormatType { get; set; } + /// List of days of the week. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of the week.", + SerializedName = @"daysOfTheWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] RetentionScheduleWeeklyDaysOfTheWeek { get; set; } + /// List of weeks of month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of weeks of month.", + SerializedName = @"weeksOfTheMonth", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] RetentionScheduleWeeklyWeeksOfTheMonth { get; set; } + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention times of retention policy.", + SerializedName = @"retentionTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] RetentionTime { get; set; } + + } + /// Monthly retention schedule. + internal partial interface IMonthlyRetentionScheduleInternal + + { + /// Retention duration of retention Policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration RetentionDuration { get; set; } + /// + /// 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. + /// + int? RetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get; set; } + /// Daily retention format for monthly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat RetentionScheduleDaily { get; set; } + /// List of days of the month. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] RetentionScheduleDailyDaysOfTheMonth { get; set; } + /// Retention schedule format type for monthly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? RetentionScheduleFormatType { get; set; } + /// Weekly retention format for monthly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat RetentionScheduleWeekly { get; set; } + /// List of days of the week. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] RetentionScheduleWeeklyDaysOfTheWeek { get; set; } + /// List of weeks of month. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] RetentionScheduleWeeklyWeeksOfTheMonth { get; set; } + /// Retention times of retention policy. + global::System.DateTime[] RetentionTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MonthlyRetentionSchedule.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MonthlyRetentionSchedule.json.cs new file mode 100644 index 000000000000..f6a7200b4c8e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MonthlyRetentionSchedule.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Monthly retention schedule. + public partial class MonthlyRetentionSchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionSchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionSchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMonthlyRetentionSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MonthlyRetentionSchedule(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MonthlyRetentionSchedule(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_retentionScheduleDaily = If( json?.PropertyT("retentionScheduleDaily"), out var __jsonRetentionScheduleDaily) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailyRetentionFormat.FromJson(__jsonRetentionScheduleDaily) : RetentionScheduleDaily;} + {_retentionScheduleWeekly = If( json?.PropertyT("retentionScheduleWeekly"), out var __jsonRetentionScheduleWeekly) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklyRetentionFormat.FromJson(__jsonRetentionScheduleWeekly) : RetentionScheduleWeekly;} + {_retentionDuration = If( json?.PropertyT("retentionDuration"), out var __jsonRetentionDuration) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration.FromJson(__jsonRetentionDuration) : RetentionDuration;} + {_retentionScheduleFormatType = If( json?.PropertyT("retentionScheduleFormatType"), out var __jsonRetentionScheduleFormatType) ? (string)__jsonRetentionScheduleFormatType : (string)RetentionScheduleFormatType;} + {_retentionTime = If( json?.PropertyT("retentionTimes"), out var __jsonRetentionTimes) ? If( __jsonRetentionTimes as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(global::System.DateTime) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? global::System.DateTime.TryParse((string)__t, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __tValue) ? __tValue : default(global::System.DateTime) : default(global::System.DateTime))) ))() : null : RetentionTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._retentionScheduleDaily ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionScheduleDaily.ToJson(null,serializationMode) : null, "retentionScheduleDaily" ,container.Add ); + AddIf( null != this._retentionScheduleWeekly ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionScheduleWeekly.ToJson(null,serializationMode) : null, "retentionScheduleWeekly" ,container.Add ); + AddIf( null != this._retentionDuration ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionDuration.ToJson(null,serializationMode) : null, "retentionDuration" ,container.Add ); + AddIf( null != (((object)this._retentionScheduleFormatType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._retentionScheduleFormatType.ToString()) : null, "retentionScheduleFormatType" ,container.Add ); + if (null != this._retentionTime) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._retentionTime ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) ,__w.Add); + } + container.Add("retentionTimes",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MoveRpAcrossTiersRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MoveRpAcrossTiersRequest.cs new file mode 100644 index 000000000000..490f17ac6a25 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MoveRpAcrossTiersRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class MoveRpAcrossTiersRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMoveRpAcrossTiersRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMoveRpAcrossTiersRequestInternal + { + + /// Backing field for property. + private string _objectType; + + /// Gets the class type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? _sourceTierType; + + /// Source tier from where RP needs to be moved + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? SourceTierType { get => this._sourceTierType; set => this._sourceTierType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? _targetTierType; + + /// Target tier where RP needs to be moved + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? TargetTierType { get => this._targetTierType; set => this._targetTierType = value; } + + /// Creates an new instance. + public MoveRpAcrossTiersRequest() + { + + } + } + public partial interface IMoveRpAcrossTiersRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Gets the class type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets the class type.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + /// Source tier from where RP needs to be moved + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source tier from where RP needs to be moved", + SerializedName = @"sourceTierType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? SourceTierType { get; set; } + /// Target tier where RP needs to be moved + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target tier where RP needs to be moved", + SerializedName = @"targetTierType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? TargetTierType { get; set; } + + } + internal partial interface IMoveRpAcrossTiersRequestInternal + + { + /// Gets the class type. + string ObjectType { get; set; } + /// Source tier from where RP needs to be moved + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? SourceTierType { get; set; } + /// Target tier where RP needs to be moved + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? TargetTierType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MoveRpAcrossTiersRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MoveRpAcrossTiersRequest.json.cs new file mode 100644 index 000000000000..0ef3db5493ba --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/MoveRpAcrossTiersRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class MoveRpAcrossTiersRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMoveRpAcrossTiersRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMoveRpAcrossTiersRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMoveRpAcrossTiersRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new MoveRpAcrossTiersRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal MoveRpAcrossTiersRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + {_sourceTierType = If( json?.PropertyT("sourceTierType"), out var __jsonSourceTierType) ? (string)__jsonSourceTierType : (string)SourceTierType;} + {_targetTierType = If( json?.PropertyT("targetTierType"), out var __jsonTargetTierType) ? (string)__jsonTargetTierType : (string)TargetTierType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AddIf( null != (((object)this._sourceTierType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceTierType.ToString()) : null, "sourceTierType" ,container.Add ); + AddIf( null != (((object)this._targetTierType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetTierType.ToString()) : null, "targetTierType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NameInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NameInfo.cs new file mode 100644 index 000000000000..37bfca304ffa --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NameInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The name of usage. + public partial class NameInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfoInternal + { + + /// Backing field for property. + private string _localizedValue; + + /// Localized value of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string LocalizedValue { get => this._localizedValue; set => this._localizedValue = value; } + + /// Backing field for property. + private string _value; + + /// Value of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NameInfo() + { + + } + } + /// The name of usage. + public partial interface INameInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Localized value of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Localized value of usage.", + SerializedName = @"localizedValue", + PossibleTypes = new [] { typeof(string) })] + string LocalizedValue { get; set; } + /// Value of usage. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value of usage.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// The name of usage. + internal partial interface INameInfoInternal + + { + /// Localized value of usage. + string LocalizedValue { get; set; } + /// Value of usage. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NameInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NameInfo.json.cs new file mode 100644 index 000000000000..6db22b37ade9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NameInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The name of usage. + public partial class NameInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INameInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new NameInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal NameInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_localizedValue = If( json?.PropertyT("localizedValue"), out var __jsonLocalizedValue) ? (string)__jsonLocalizedValue : (string)LocalizedValue;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != (((object)this._localizedValue)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._localizedValue.ToString()) : null, "localizedValue" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponse.cs new file mode 100644 index 000000000000..0acc6ce43d1b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponse.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource management error response. + public partial class NewErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseInternal + { + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).AdditionalInfo; } + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Code; } + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Detail; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseError _error; + + /// The error object. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponseError()); set => this._error = value; } + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).AdditionalInfo = value; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Code = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Detail = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseError Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponseError()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Message = value; } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Target = value; } + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal)Error).Target; } + + /// Creates an new instance. + public NewErrorResponse() + { + + } + } + /// The resource management error response. + public partial interface INewErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse[] Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error target.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// The resource management error response. + internal partial interface INewErrorResponseInternal + + { + /// The error additional info. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse[] Detail { get; set; } + /// The error object. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseError Error { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponse.json.cs new file mode 100644 index 000000000000..a73a4f53f8aa --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponse.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource management error response. + public partial class NewErrorResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new NewErrorResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal NewErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponseError.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponseError.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponseError.cs new file mode 100644 index 000000000000..98847d9b25d2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponseError.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The error object. + public partial class NewErrorResponseError : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseError, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] _additionalInfo; + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } + + /// Backing field for property. + private string _code; + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse[] _detail; + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse[] Detail { get => this._detail; } + + /// Backing field for property. + private string _message; + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal.Detail { get => this._detail; set { {_detail = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseErrorInternal.Target { get => this._target; set { {_target = value;} } } + + /// Backing field for property. + private string _target; + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Target { get => this._target; } + + /// Creates an new instance. + public NewErrorResponseError() + { + + } + } + /// The error object. + public partial interface INewErrorResponseError : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse[] Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error target.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// The error object. + internal partial interface INewErrorResponseErrorInternal + + { + /// The error additional info. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse[] Detail { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponseError.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponseError.json.cs new file mode 100644 index 000000000000..641d93b96dbf --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/NewErrorResponseError.json.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The error object. + public partial class NewErrorResponseError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new NewErrorResponseError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal NewErrorResponseError(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.INewErrorResponse) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(__u) )) ))() : null : Detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : AdditionalInfo;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._detail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._detail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("details",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._additionalInfo) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._additionalInfo ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("additionalInfo",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfo.cs new file mode 100644 index 000000000000..3c41d02ba427 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation result info. + public partial class OperationResultInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase __operationResultInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationResultInfoBase(); + + /// Backing field for property. + private string[] _jobList; + + /// List of jobs created by this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] JobList { get => this._jobList; set => this._jobList = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseInternal)__operationResultInfoBase).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseInternal)__operationResultInfoBase).ObjectType = value ; } + + /// Creates an new instance. + public OperationResultInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__operationResultInfoBase), __operationResultInfoBase); + await eventListener.AssertObjectIsValid(nameof(__operationResultInfoBase), __operationResultInfoBase); + } + } + /// Operation result info. + public partial interface IOperationResultInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase + { + /// List of jobs created by this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of jobs created by this operation.", + SerializedName = @"jobList", + PossibleTypes = new [] { typeof(string) })] + string[] JobList { get; set; } + + } + /// Operation result info. + internal partial interface IOperationResultInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseInternal + { + /// List of jobs created by this operation. + string[] JobList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfo.json.cs new file mode 100644 index 000000000000..31cfd3e0ece4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation result info. + public partial class OperationResultInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationResultInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationResultInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __operationResultInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationResultInfoBase(json); + {_jobList = If( json?.PropertyT("jobList"), out var __jsonJobList) ? If( __jsonJobList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : JobList;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __operationResultInfoBase?.ToJson(container, serializationMode); + if (null != this._jobList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._jobList ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("jobList",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBase.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBase.cs new file mode 100644 index 000000000000..6f3361473204 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBase.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for operation result info. + public partial class OperationResultInfoBase : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseInternal + { + + /// Backing field for property. + private string _objectType; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Creates an new instance. + public OperationResultInfoBase() + { + + } + } + /// Base class for operation result info. + public partial interface IOperationResultInfoBase : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Base class for operation result info. + internal partial interface IOperationResultInfoBaseInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBase.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBase.json.cs new file mode 100644 index 000000000000..c9233debfa7a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBase.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for operation result info. + public partial class OperationResultInfoBase + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "ExportJobsOperationResultInfo": + { + return new ExportJobsOperationResultInfo(json); + } + case "OperationResultInfo": + { + return new OperationResultInfo(json); + } + } + return new OperationResultInfoBase(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationResultInfoBase(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBaseResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBaseResource.cs new file mode 100644 index 000000000000..32a1addc5045 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBaseResource.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for operation result info. + public partial class OperationResultInfoBaseResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponse __operationWorkerResponse = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationWorkerResponse(); + + /// HTTP headers associated with this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeaders Header { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseInternal)__operationWorkerResponse).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseInternal)__operationWorkerResponse).Header = value ?? null /* model class */; } + + /// Internal Acessors for Operation + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseResourceInternal.Operation { get => (this._operation = this._operation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationResultInfoBase()); set { {_operation = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase _operation; + + /// OperationResultInfoBaseResource operation + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase Operation { get => (this._operation = this._operation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationResultInfoBase()); set => this._operation = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string OperationObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseInternal)Operation).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseInternal)Operation).ObjectType = value ?? null; } + + /// HTTP Status Code of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode? StatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseInternal)__operationWorkerResponse).StatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseInternal)__operationWorkerResponse).StatusCode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode)""); } + + /// Creates an new instance. + public OperationResultInfoBaseResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__operationWorkerResponse), __operationWorkerResponse); + await eventListener.AssertObjectIsValid(nameof(__operationWorkerResponse), __operationWorkerResponse); + } + } + /// Base class for operation result info. + public partial interface IOperationResultInfoBaseResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponse + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string OperationObjectType { get; set; } + + } + /// Base class for operation result info. + internal partial interface IOperationResultInfoBaseResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseInternal + { + /// OperationResultInfoBaseResource operation + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBase Operation { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string OperationObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBaseResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBaseResource.json.cs new file mode 100644 index 000000000000..8e8f99cb085e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationResultInfoBaseResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for operation result info. + public partial class OperationResultInfoBaseResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationResultInfoBaseResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationResultInfoBaseResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationResultInfoBaseResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __operationWorkerResponse = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationWorkerResponse(json); + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationResultInfoBase.FromJson(__jsonOperation) : Operation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __operationWorkerResponse?.ToJson(container, serializationMode); + AddIf( null != this._operation ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._operation.ToJson(null,serializationMode) : null, "operation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatus.cs new file mode 100644 index 000000000000..457869ca8e7c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatus.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status. + public partial class OperationStatus : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatus, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusInternal + { + + /// Error code of the operation failure. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusErrorInternal)Error).Code = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// Operation end time. Format: ISO-8601. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusError _error; + + /// Error information related to this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusError()); set => this._error = value; } + + /// Backing field for property. + private string _id; + + /// ID of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Error message displayed if the operation failure. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusErrorInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusError Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusError()); set { {_error = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo()); set { {_property = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal)Property).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal)Property).ObjectType = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo _property; + + /// Additional information associated with this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo()); set => this._property = value; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// Operation start time. Format: ISO-8601. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues? _status; + + /// Operation status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public OperationStatus() + { + + } + } + /// Operation status. + public partial interface IOperationStatus : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code of the operation failure. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code of the operation failure.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Operation end time. Format: ISO-8601. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation end time. Format: ISO-8601.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// ID of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the operation.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Error message displayed if the operation failure. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message displayed if the operation failure.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the operation.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + /// Operation start time. Format: ISO-8601. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation start time. Format: ISO-8601.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// Operation status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues? Status { get; set; } + + } + /// Operation status. + internal partial interface IOperationStatusInternal + + { + /// Error code of the operation failure. + string Code { get; set; } + /// Operation end time. Format: ISO-8601. + global::System.DateTime? EndTime { get; set; } + /// Error information related to this operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusError Error { get; set; } + /// ID of the operation. + string Id { get; set; } + /// Error message displayed if the operation failure. + string Message { get; set; } + /// Name of the operation. + string Name { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + /// Additional information associated with this operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo Property { get; set; } + /// Operation start time. Format: ISO-8601. + global::System.DateTime? StartTime { get; set; } + /// Operation status. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatus.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatus.json.cs new file mode 100644 index 000000000000..8b8e6f5f1d37 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatus.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status. + public partial class OperationStatus + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatus. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatus. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationStatus(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationStatus(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusError.FromJson(__jsonError) : Error;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusError.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusError.cs new file mode 100644 index 000000000000..c3606627b646 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusError.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Error information associated with operation status call. + public partial class OperationStatusError : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusError, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusErrorInternal + { + + /// Backing field for property. + private string _code; + + /// Error code of the operation failure. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + /// Error message displayed if the operation failure. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public OperationStatusError() + { + + } + } + /// Error information associated with operation status call. + public partial interface IOperationStatusError : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code of the operation failure. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code of the operation failure.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Error message displayed if the operation failure. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message displayed if the operation failure.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// Error information associated with operation status call. + internal partial interface IOperationStatusErrorInternal + + { + /// Error code of the operation failure. + string Code { get; set; } + /// Error message displayed if the operation failure. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusError.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusError.json.cs new file mode 100644 index 000000000000..6efdea6d6cc7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusError.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Error information associated with operation status call. + public partial class OperationStatusError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusError FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationStatusError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationStatusError(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusExtendedInfo.cs new file mode 100644 index 000000000000..9ad0f7bc044c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for additional information of operation status. + public partial class OperationStatusExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal + { + + /// Backing field for property. + private string _objectType; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Creates an new instance. + public OperationStatusExtendedInfo() + { + + } + } + /// Base class for additional information of operation status. + public partial interface IOperationStatusExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Base class for additional information of operation status. + internal partial interface IOperationStatusExtendedInfoInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusExtendedInfo.json.cs new file mode 100644 index 000000000000..50ebd2731f5e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for additional information of operation status. + public partial class OperationStatusExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "OperationStatusJobExtendedInfo": + { + return new OperationStatusJobExtendedInfo(json); + } + case "OperationStatusJobsExtendedInfo": + { + return new OperationStatusJobsExtendedInfo(json); + } + case "OperationStatusProvisionILRExtendedInfo": + { + return new OperationStatusProvisionIlrExtendedInfo(json); + } + case "OperationStatusValidateOperationExtendedInfo": + { + return new OperationStatusValidateOperationExtendedInfo(json); + } + } + return new OperationStatusExtendedInfo(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationStatusExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobExtendedInfo.cs new file mode 100644 index 000000000000..f5a36015ea87 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status job extended info. + public partial class OperationStatusJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobExtendedInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo(); + + /// Backing field for property. + private string _jobId; + + /// ID of the job created for this protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string JobId { get => this._jobId; set => this._jobId = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType = value ; } + + /// Creates an new instance. + public OperationStatusJobExtendedInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__operationStatusExtendedInfo), __operationStatusExtendedInfo); + await eventListener.AssertObjectIsValid(nameof(__operationStatusExtendedInfo), __operationStatusExtendedInfo); + } + } + /// Operation status job extended info. + public partial interface IOperationStatusJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo + { + /// ID of the job created for this protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the job created for this protected item.", + SerializedName = @"jobId", + PossibleTypes = new [] { typeof(string) })] + string JobId { get; set; } + + } + /// Operation status job extended info. + internal partial interface IOperationStatusJobExtendedInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal + { + /// ID of the job created for this protected item. + string JobId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobExtendedInfo.json.cs new file mode 100644 index 000000000000..2c75e5e8dedc --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status job extended info. + public partial class OperationStatusJobExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationStatusJobExtendedInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationStatusJobExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo(json); + {_jobId = If( json?.PropertyT("jobId"), out var __jsonJobId) ? (string)__jsonJobId : (string)JobId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __operationStatusExtendedInfo?.ToJson(container, serializationMode); + AddIf( null != (((object)this._jobId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._jobId.ToString()) : null, "jobId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfo.cs new file mode 100644 index 000000000000..785e954096e3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status extended info for list of jobs. + public partial class OperationStatusJobsExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoFailedJobsError _failedJobsError; + + /// Stores all the failed jobs along with the corresponding error codes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoFailedJobsError FailedJobsError { get => (this._failedJobsError = this._failedJobsError ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusJobsExtendedInfoFailedJobsError()); set => this._failedJobsError = value; } + + /// Backing field for property. + private string[] _jobId; + + /// IDs of the jobs created for the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] JobId { get => this._jobId; set => this._jobId = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType = value ; } + + /// Creates an new instance. + public OperationStatusJobsExtendedInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__operationStatusExtendedInfo), __operationStatusExtendedInfo); + await eventListener.AssertObjectIsValid(nameof(__operationStatusExtendedInfo), __operationStatusExtendedInfo); + } + } + /// Operation status extended info for list of jobs. + public partial interface IOperationStatusJobsExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo + { + /// Stores all the failed jobs along with the corresponding error codes. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Stores all the failed jobs along with the corresponding error codes.", + SerializedName = @"failedJobsError", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoFailedJobsError) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoFailedJobsError FailedJobsError { get; set; } + /// IDs of the jobs created for the protected item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IDs of the jobs created for the protected item.", + SerializedName = @"jobIds", + PossibleTypes = new [] { typeof(string) })] + string[] JobId { get; set; } + + } + /// Operation status extended info for list of jobs. + internal partial interface IOperationStatusJobsExtendedInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal + { + /// Stores all the failed jobs along with the corresponding error codes. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoFailedJobsError FailedJobsError { get; set; } + /// IDs of the jobs created for the protected item. + string[] JobId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfo.json.cs new file mode 100644 index 000000000000..165d3f314d78 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status extended info for list of jobs. + public partial class OperationStatusJobsExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationStatusJobsExtendedInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationStatusJobsExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo(json); + {_jobId = If( json?.PropertyT("jobIds"), out var __jsonJobIds) ? If( __jsonJobIds as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : JobId;} + {_failedJobsError = If( json?.PropertyT("failedJobsError"), out var __jsonFailedJobsError) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusJobsExtendedInfoFailedJobsError.FromJson(__jsonFailedJobsError) : FailedJobsError;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __operationStatusExtendedInfo?.ToJson(container, serializationMode); + if (null != this._jobId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._jobId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("jobIds",__w); + } + AddIf( null != this._failedJobsError ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._failedJobsError.ToJson(null,serializationMode) : null, "failedJobsError" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.cs new file mode 100644 index 000000000000..ebacadff76d7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Stores all the failed jobs along with the corresponding error codes. + public partial class OperationStatusJobsExtendedInfoFailedJobsError : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoFailedJobsError, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoFailedJobsErrorInternal + { + + /// + /// Creates an new instance. + /// + public OperationStatusJobsExtendedInfoFailedJobsError() + { + + } + } + /// Stores all the failed jobs along with the corresponding error codes. + public partial interface IOperationStatusJobsExtendedInfoFailedJobsError : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Stores all the failed jobs along with the corresponding error codes. + internal partial interface IOperationStatusJobsExtendedInfoFailedJobsErrorInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.dictionary.cs new file mode 100644 index 000000000000..1ee8c46b9cbd --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class OperationStatusJobsExtendedInfoFailedJobsError : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusJobsExtendedInfoFailedJobsError source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.json.cs new file mode 100644 index 000000000000..2636ffd13e2c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusJobsExtendedInfoFailedJobsError.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Stores all the failed jobs along with the corresponding error codes. + public partial class OperationStatusJobsExtendedInfoFailedJobsError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoFailedJobsError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoFailedJobsError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusJobsExtendedInfoFailedJobsError FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationStatusJobsExtendedInfoFailedJobsError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal OperationStatusJobsExtendedInfoFailedJobsError(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusProvisionIlrExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusProvisionIlrExtendedInfo.cs new file mode 100644 index 000000000000..b31cbbb00695 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusProvisionIlrExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status extended info for ILR provision action. + public partial class OperationStatusProvisionIlrExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusProvisionIlrExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusProvisionIlrExtendedInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo(); + + /// Internal Acessors for RecoveryTarget + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTarget Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusProvisionIlrExtendedInfoInternal.RecoveryTarget { get => (this._recoveryTarget = this._recoveryTarget ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InstantItemRecoveryTarget()); set { {_recoveryTarget = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTarget _recoveryTarget; + + /// Target details for file / folder restore. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTarget RecoveryTarget { get => (this._recoveryTarget = this._recoveryTarget ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InstantItemRecoveryTarget()); set => this._recoveryTarget = value; } + + /// List of client scripts. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect[] RecoveryTargetClientScript { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTargetInternal)RecoveryTarget).ClientScript; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTargetInternal)RecoveryTarget).ClientScript = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public OperationStatusProvisionIlrExtendedInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__operationStatusExtendedInfo), __operationStatusExtendedInfo); + await eventListener.AssertObjectIsValid(nameof(__operationStatusExtendedInfo), __operationStatusExtendedInfo); + } + } + /// Operation status extended info for ILR provision action. + public partial interface IOperationStatusProvisionIlrExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo + { + /// List of client scripts. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of client scripts.", + SerializedName = @"clientScripts", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect[] RecoveryTargetClientScript { get; set; } + + } + /// Operation status extended info for ILR provision action. + internal partial interface IOperationStatusProvisionIlrExtendedInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal + { + /// Target details for file / folder restore. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInstantItemRecoveryTarget RecoveryTarget { get; set; } + /// List of client scripts. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IClientScriptForConnect[] RecoveryTargetClientScript { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusProvisionIlrExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusProvisionIlrExtendedInfo.json.cs new file mode 100644 index 000000000000..408cda6392e6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusProvisionIlrExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status extended info for ILR provision action. + public partial class OperationStatusProvisionIlrExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusProvisionIlrExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusProvisionIlrExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusProvisionIlrExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationStatusProvisionIlrExtendedInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationStatusProvisionIlrExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo(json); + {_recoveryTarget = If( json?.PropertyT("recoveryTarget"), out var __jsonRecoveryTarget) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InstantItemRecoveryTarget.FromJson(__jsonRecoveryTarget) : RecoveryTarget;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __operationStatusExtendedInfo?.ToJson(container, serializationMode); + AddIf( null != this._recoveryTarget ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryTarget.ToJson(null,serializationMode) : null, "recoveryTarget" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusValidateOperationExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusValidateOperationExtendedInfo.cs new file mode 100644 index 000000000000..9ad735f204b7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusValidateOperationExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status extended info for ValidateOperation action. + public partial class OperationStatusValidateOperationExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusValidateOperationExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusValidateOperationExtendedInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo(); + + /// Internal Acessors for ValidateOperationResponse + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusValidateOperationExtendedInfoInternal.ValidateOperationResponse { get => (this._validateOperationResponse = this._validateOperationResponse ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateOperationResponse()); set { {_validateOperationResponse = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse _validateOperationResponse; + + /// Gets the validation operation response + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse ValidateOperationResponse { get => (this._validateOperationResponse = this._validateOperationResponse ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateOperationResponse()); set => this._validateOperationResponse = value; } + + /// Gets the validation result + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail[] ValidateOperationResponseValidationResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponseInternal)ValidateOperationResponse).ValidationResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponseInternal)ValidateOperationResponse).ValidationResult = value ?? null /* arrayOf */; } + + /// + /// Creates an new instance. + /// + public OperationStatusValidateOperationExtendedInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__operationStatusExtendedInfo), __operationStatusExtendedInfo); + await eventListener.AssertObjectIsValid(nameof(__operationStatusExtendedInfo), __operationStatusExtendedInfo); + } + } + /// Operation status extended info for ValidateOperation action. + public partial interface IOperationStatusValidateOperationExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfo + { + /// Gets the validation result + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets the validation result", + SerializedName = @"validationResults", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail[] ValidateOperationResponseValidationResult { get; set; } + + } + /// Operation status extended info for ValidateOperation action. + internal partial interface IOperationStatusValidateOperationExtendedInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusExtendedInfoInternal + { + /// Gets the validation operation response + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse ValidateOperationResponse { get; set; } + /// Gets the validation result + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail[] ValidateOperationResponseValidationResult { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusValidateOperationExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusValidateOperationExtendedInfo.json.cs new file mode 100644 index 000000000000..89f647f7310d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationStatusValidateOperationExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status extended info for ValidateOperation action. + public partial class OperationStatusValidateOperationExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusValidateOperationExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusValidateOperationExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationStatusValidateOperationExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationStatusValidateOperationExtendedInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationStatusValidateOperationExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatusExtendedInfo(json); + {_validateOperationResponse = If( json?.PropertyT("validateOperationResponse"), out var __jsonValidateOperationResponse) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateOperationResponse.FromJson(__jsonValidateOperationResponse) : ValidateOperationResponse;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __operationStatusExtendedInfo?.ToJson(container, serializationMode); + AddIf( null != this._validateOperationResponse ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._validateOperationResponse.ToJson(null,serializationMode) : null, "validateOperationResponse" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponse.cs new file mode 100644 index 000000000000..0caac58a1a04 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponse.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// This is the base class for operation result responses. + public partial class OperationWorkerResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeaders _header; + + /// HTTP headers associated with this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeaders Header { get => (this._header = this._header ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationWorkerResponseHeaders()); set => this._header = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode? _statusCode; + + /// HTTP Status Code of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode? StatusCode { get => this._statusCode; set => this._statusCode = value; } + + /// Creates an new instance. + public OperationWorkerResponse() + { + + } + } + /// This is the base class for operation result responses. + public partial interface IOperationWorkerResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// HTTP headers associated with this operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP headers associated with this operation.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeaders) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeaders Header { get; set; } + /// HTTP Status Code of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP Status Code of the operation.", + SerializedName = @"statusCode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode? StatusCode { get; set; } + + } + /// This is the base class for operation result responses. + internal partial interface IOperationWorkerResponseInternal + + { + /// HTTP headers associated with this operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeaders Header { get; set; } + /// HTTP Status Code of the operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode? StatusCode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponse.json.cs new file mode 100644 index 000000000000..3610cb64a254 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponse.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// This is the base class for operation result responses. + public partial class OperationWorkerResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationWorkerResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal OperationWorkerResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_statusCode = If( json?.PropertyT("statusCode"), out var __jsonStatusCode) ? (string)__jsonStatusCode : (string)StatusCode;} + {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationWorkerResponseHeaders.FromJson(__jsonHeaders) : Header;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._statusCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._statusCode.ToString()) : null, "statusCode" ,container.Add ); + AddIf( null != this._header ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._header.ToJson(null,serializationMode) : null, "headers" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.cs new file mode 100644 index 000000000000..cccc27923b2f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// HTTP headers associated with this operation. + public partial class OperationWorkerResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeadersInternal + { + + /// Creates an new instance. + public OperationWorkerResponseHeaders() + { + + } + } + /// HTTP headers associated with this operation. + public partial interface IOperationWorkerResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// HTTP headers associated with this operation. + internal partial interface IOperationWorkerResponseHeadersInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.dictionary.cs new file mode 100644 index 000000000000..9ea46738d707 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class OperationWorkerResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string[] this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string[] value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string[] value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationWorkerResponseHeaders source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.json.cs new file mode 100644 index 000000000000..3c2f53e52716 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/OperationWorkerResponseHeaders.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// HTTP headers associated with this operation. + public partial class OperationWorkerResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IOperationWorkerResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationWorkerResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal OperationWorkerResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PointInTimeRange.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PointInTimeRange.cs new file mode 100644 index 000000000000..0c0b4dc54445 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PointInTimeRange.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Provides details for log ranges + public partial class PointInTimeRange : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRangeInternal + { + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// End time of the time range for log recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// Start time of the time range for log recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Creates an new instance. + public PointInTimeRange() + { + + } + } + /// Provides details for log ranges + public partial interface IPointInTimeRange : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// End time of the time range for log recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End time of the time range for log recovery.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// Start time of the time range for log recovery. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start time of the time range for log recovery.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + + } + /// Provides details for log ranges + internal partial interface IPointInTimeRangeInternal + + { + /// End time of the time range for log recovery. + global::System.DateTime? EndTime { get; set; } + /// Start time of the time range for log recovery. + global::System.DateTime? StartTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PointInTimeRange.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PointInTimeRange.json.cs new file mode 100644 index 000000000000..8e0273c30db6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PointInTimeRange.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Provides details for log ranges + public partial class PointInTimeRange + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPointInTimeRange FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PointInTimeRange(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal PointInTimeRange(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreBackupValidation.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreBackupValidation.cs new file mode 100644 index 000000000000..57502a520cf7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreBackupValidation.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Pre-backup validation for Azure VM Workload provider. + public partial class PreBackupValidation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidationInternal + { + + /// Backing field for property. + private string _code; + + /// Error code of protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + /// Message corresponding to the error code for the protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? _status; + + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public PreBackupValidation() + { + + } + } + /// Pre-backup validation for Azure VM Workload provider. + public partial interface IPreBackupValidation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code of protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code of protectable item", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Message corresponding to the error code for the protectable item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Message corresponding to the error code for the protectable item", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of protectable item, i.e. InProgress,Succeeded,Failed", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? Status { get; set; } + + } + /// Pre-backup validation for Azure VM Workload provider. + internal partial interface IPreBackupValidationInternal + + { + /// Error code of protectable item + string Code { get; set; } + /// Message corresponding to the error code for the protectable item + string Message { get; set; } + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreBackupValidation.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreBackupValidation.json.cs new file mode 100644 index 000000000000..3b454c2650f6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreBackupValidation.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Pre-backup validation for Azure VM Workload provider. + public partial class PreBackupValidation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreBackupValidation FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PreBackupValidation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal PreBackupValidation(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupRequest.cs new file mode 100644 index 000000000000..141f3c9275ce --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// 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 : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupRequestInternal + { + + /// Backing field for property. + private string _property; + + /// Configuration of VM if any needs to be validated like OS type etc + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Property { get => this._property; set => this._property = value; } + + /// Backing field for property. + private string _resourceId; + + /// ARM Virtual Machine Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? _resourceType; + + /// ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? ResourceType { get => this._resourceType; set => this._resourceType = value; } + + /// Backing field for property. + private string _vaultId; + + /// ARM id of the Recovery Services Vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VaultId { get => this._vaultId; set => this._vaultId = value; } + + /// Creates an new instance. + public PreValidateEnableBackupRequest() + { + + } + } + /// 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 interface IPreValidateEnableBackupRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Configuration of VM if any needs to be validated like OS type etc + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Configuration of VM if any needs to be validated like OS type etc", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(string) })] + string Property { get; set; } + /// ARM Virtual Machine Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM Virtual Machine Id", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? ResourceType { get; set; } + /// ARM id of the Recovery Services Vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM id of the Recovery Services Vault", + SerializedName = @"vaultId", + PossibleTypes = new [] { typeof(string) })] + string VaultId { get; set; } + + } + /// 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. + internal partial interface IPreValidateEnableBackupRequestInternal + + { + /// Configuration of VM if any needs to be validated like OS type etc + string Property { get; set; } + /// ARM Virtual Machine Id + string ResourceId { get; set; } + /// ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? ResourceType { get; set; } + /// ARM id of the Recovery Services Vault + string VaultId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupRequest.json.cs new file mode 100644 index 000000000000..c0ccd673377a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupRequest.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// 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 + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PreValidateEnableBackupRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal PreValidateEnableBackupRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_vaultId = If( json?.PropertyT("vaultId"), out var __jsonVaultId) ? (string)__jsonVaultId : (string)VaultId;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? (string)__jsonProperties : (string)Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != (((object)this._vaultId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._vaultId.ToString()) : null, "vaultId" ,container.Add ); + AddIf( null != (((object)this._property)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._property.ToString()) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupResponse.cs new file mode 100644 index 000000000000..11bce36497fd --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupResponse.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Response contract for enable backup validation request + public partial class PreValidateEnableBackupResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupResponseInternal + { + + /// Backing field for property. + private string _containerName; + + /// + /// Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + /// for portal + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private string _errorCode; + + /// Response error code + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorCode { get => this._errorCode; set => this._errorCode = value; } + + /// Backing field for property. + private string _errorMessage; + + /// Response error message + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorMessage { get => this._errorMessage; set => this._errorMessage = value; } + + /// Backing field for property. + private string _protectedItemName; + + /// + /// Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectedItemName { get => this._protectedItemName; set => this._protectedItemName = value; } + + /// Backing field for property. + private string _recommendation; + + /// Recommended action for user + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Recommendation { get => this._recommendation; set => this._recommendation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus? _status; + + /// Validation Status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public PreValidateEnableBackupResponse() + { + + } + } + /// Response contract for enable backup validation request + public partial interface IPreValidateEnableBackupResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + /// for portal + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + for portal", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Response error code + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Response error code", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(string) })] + string ErrorCode { get; set; } + /// Response error message + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Response error message", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorMessage { get; set; } + /// + /// Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal", + SerializedName = @"protectedItemName", + PossibleTypes = new [] { typeof(string) })] + string ProtectedItemName { get; set; } + /// Recommended action for user + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recommended action for user", + SerializedName = @"recommendation", + PossibleTypes = new [] { typeof(string) })] + string Recommendation { get; set; } + /// Validation Status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Validation Status", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus? Status { get; set; } + + } + /// Response contract for enable backup validation request + internal partial interface IPreValidateEnableBackupResponseInternal + + { + /// + /// Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + /// for portal + /// + string ContainerName { get; set; } + /// Response error code + string ErrorCode { get; set; } + /// Response error message + string ErrorMessage { get; set; } + /// + /// Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal + /// + string ProtectedItemName { get; set; } + /// Recommended action for user + string Recommendation { get; set; } + /// Validation Status + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupResponse.json.cs new file mode 100644 index 000000000000..2c39995d15e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PreValidateEnableBackupResponse.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Response contract for enable backup validation request + public partial class PreValidateEnableBackupResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PreValidateEnableBackupResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal PreValidateEnableBackupResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (string)__jsonErrorCode : (string)ErrorCode;} + {_errorMessage = If( json?.PropertyT("errorMessage"), out var __jsonErrorMessage) ? (string)__jsonErrorMessage : (string)ErrorMessage;} + {_recommendation = If( json?.PropertyT("recommendation"), out var __jsonRecommendation) ? (string)__jsonRecommendation : (string)Recommendation;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_protectedItemName = If( json?.PropertyT("protectedItemName"), out var __jsonProtectedItemName) ? (string)__jsonProtectedItemName : (string)ProtectedItemName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._errorCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorCode.ToString()) : null, "errorCode" ,container.Add ); + AddIf( null != (((object)this._errorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorMessage.ToString()) : null, "errorMessage" ,container.Add ); + AddIf( null != (((object)this._recommendation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recommendation.ToString()) : null, "recommendation" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._protectedItemName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectedItemName.ToString()) : null, "protectedItemName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveRequest.cs new file mode 100644 index 000000000000..72e33fab2fa5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Prepare DataMove Request + public partial class PrepareDataMoveRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveRequestInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel _dataMoveLevel; + + /// DataMove Level + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel DataMoveLevel { get => this._dataMoveLevel; set => this._dataMoveLevel = value; } + + /// Backing field for property. + private bool? _ignoreMoved; + + /// Ignore the artifacts which are already moved. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IgnoreMoved { get => this._ignoreMoved; set => this._ignoreMoved = value; } + + /// Backing field for property. + private string[] _sourceContainerArmId; + + /// + /// Source Container ArmIds + /// This needs to be populated only if DataMoveLevel is set to container + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] SourceContainerArmId { get => this._sourceContainerArmId; set => this._sourceContainerArmId = value; } + + /// Backing field for property. + private string _targetRegion; + + /// Target Region + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetRegion { get => this._targetRegion; set => this._targetRegion = value; } + + /// Backing field for property. + private string _targetResourceId; + + /// ARM Id of target vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetResourceId { get => this._targetResourceId; set => this._targetResourceId = value; } + + /// Creates an new instance. + public PrepareDataMoveRequest() + { + + } + } + /// Prepare DataMove Request + public partial interface IPrepareDataMoveRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// DataMove Level + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"DataMove Level", + SerializedName = @"dataMoveLevel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel DataMoveLevel { get; set; } + /// Ignore the artifacts which are already moved. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ignore the artifacts which are already moved.", + SerializedName = @"ignoreMoved", + PossibleTypes = new [] { typeof(bool) })] + bool? IgnoreMoved { get; set; } + /// + /// Source Container ArmIds + /// This needs to be populated only if DataMoveLevel is set to container + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source Container ArmIds + This needs to be populated only if DataMoveLevel is set to container", + SerializedName = @"sourceContainerArmIds", + PossibleTypes = new [] { typeof(string) })] + string[] SourceContainerArmId { get; set; } + /// Target Region + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Target Region", + SerializedName = @"targetRegion", + PossibleTypes = new [] { typeof(string) })] + string TargetRegion { get; set; } + /// ARM Id of target vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ARM Id of target vault", + SerializedName = @"targetResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetResourceId { get; set; } + + } + /// Prepare DataMove Request + internal partial interface IPrepareDataMoveRequestInternal + + { + /// DataMove Level + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel DataMoveLevel { get; set; } + /// Ignore the artifacts which are already moved. + bool? IgnoreMoved { get; set; } + /// + /// Source Container ArmIds + /// This needs to be populated only if DataMoveLevel is set to container + /// + string[] SourceContainerArmId { get; set; } + /// Target Region + string TargetRegion { get; set; } + /// ARM Id of target vault + string TargetResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveRequest.json.cs new file mode 100644 index 000000000000..2a7672d5a875 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Prepare DataMove Request + public partial class PrepareDataMoveRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PrepareDataMoveRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal PrepareDataMoveRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetResourceId = If( json?.PropertyT("targetResourceId"), out var __jsonTargetResourceId) ? (string)__jsonTargetResourceId : (string)TargetResourceId;} + {_targetRegion = If( json?.PropertyT("targetRegion"), out var __jsonTargetRegion) ? (string)__jsonTargetRegion : (string)TargetRegion;} + {_dataMoveLevel = If( json?.PropertyT("dataMoveLevel"), out var __jsonDataMoveLevel) ? (string)__jsonDataMoveLevel : (string)DataMoveLevel;} + {_sourceContainerArmId = If( json?.PropertyT("sourceContainerArmIds"), out var __jsonSourceContainerArmIds) ? If( __jsonSourceContainerArmIds as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SourceContainerArmId;} + {_ignoreMoved = If( json?.PropertyT("ignoreMoved"), out var __jsonIgnoreMoved) ? (bool?)__jsonIgnoreMoved : IgnoreMoved;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._targetResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetResourceId.ToString()) : null, "targetResourceId" ,container.Add ); + AddIf( null != (((object)this._targetRegion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetRegion.ToString()) : null, "targetRegion" ,container.Add ); + AddIf( null != (((object)this._dataMoveLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dataMoveLevel.ToString()) : null, "dataMoveLevel" ,container.Add ); + if (null != this._sourceContainerArmId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._sourceContainerArmId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("sourceContainerArmIds",__w); + } + AddIf( null != this._ignoreMoved ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._ignoreMoved) : null, "ignoreMoved" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponse.cs new file mode 100644 index 000000000000..cb0cde3ca9a7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponse.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Prepare DataMove Response + public partial class PrepareDataMoveResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponse __vaultStorageConfigOperationResultResponse = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.VaultStorageConfigOperationResultResponse(); + + /// Backing field for property. + private string _correlationId; + + /// Co-relationId for move operation + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string CorrelationId { get => this._correlationId; set => this._correlationId = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponseInternal)__vaultStorageConfigOperationResultResponse).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponseInternal)__vaultStorageConfigOperationResultResponse).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseSourceVaultProperties _sourceVaultProperty; + + /// Source Vault Properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseSourceVaultProperties SourceVaultProperty { get => (this._sourceVaultProperty = this._sourceVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrepareDataMoveResponseSourceVaultProperties()); set => this._sourceVaultProperty = value; } + + /// Creates an new instance. + public PrepareDataMoveResponse() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__vaultStorageConfigOperationResultResponse), __vaultStorageConfigOperationResultResponse); + await eventListener.AssertObjectIsValid(nameof(__vaultStorageConfigOperationResultResponse), __vaultStorageConfigOperationResultResponse); + } + } + /// Prepare DataMove Response + public partial interface IPrepareDataMoveResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponse + { + /// Co-relationId for move operation + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Co-relationId for move operation", + SerializedName = @"correlationId", + PossibleTypes = new [] { typeof(string) })] + string CorrelationId { get; set; } + /// Source Vault Properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source Vault Properties", + SerializedName = @"sourceVaultProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseSourceVaultProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseSourceVaultProperties SourceVaultProperty { get; set; } + + } + /// Prepare DataMove Response + internal partial interface IPrepareDataMoveResponseInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponseInternal + { + /// Co-relationId for move operation + string CorrelationId { get; set; } + /// Source Vault Properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseSourceVaultProperties SourceVaultProperty { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponse.json.cs new file mode 100644 index 000000000000..1cc3a86c086d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponse.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Prepare DataMove Response + public partial class PrepareDataMoveResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PrepareDataMoveResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal PrepareDataMoveResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __vaultStorageConfigOperationResultResponse = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.VaultStorageConfigOperationResultResponse(json); + {_correlationId = If( json?.PropertyT("correlationId"), out var __jsonCorrelationId) ? (string)__jsonCorrelationId : (string)CorrelationId;} + {_sourceVaultProperty = If( json?.PropertyT("sourceVaultProperties"), out var __jsonSourceVaultProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrepareDataMoveResponseSourceVaultProperties.FromJson(__jsonSourceVaultProperties) : SourceVaultProperty;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __vaultStorageConfigOperationResultResponse?.ToJson(container, serializationMode); + AddIf( null != (((object)this._correlationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._correlationId.ToString()) : null, "correlationId" ,container.Add ); + AddIf( null != this._sourceVaultProperty ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._sourceVaultProperty.ToJson(null,serializationMode) : null, "sourceVaultProperties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.cs new file mode 100644 index 000000000000..b9b6734dfb25 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Source Vault Properties + public partial class PrepareDataMoveResponseSourceVaultProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseSourceVaultProperties, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseSourceVaultPropertiesInternal + { + + /// + /// Creates an new instance. + /// + public PrepareDataMoveResponseSourceVaultProperties() + { + + } + } + /// Source Vault Properties + public partial interface IPrepareDataMoveResponseSourceVaultProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Source Vault Properties + internal partial interface IPrepareDataMoveResponseSourceVaultPropertiesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.dictionary.cs new file mode 100644 index 000000000000..88c400b9e1b7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class PrepareDataMoveResponseSourceVaultProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrepareDataMoveResponseSourceVaultProperties source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.json.cs new file mode 100644 index 000000000000..a90d1da30dbc --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrepareDataMoveResponseSourceVaultProperties.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Source Vault Properties + public partial class PrepareDataMoveResponseSourceVaultProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseSourceVaultProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseSourceVaultProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveResponseSourceVaultProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PrepareDataMoveResponseSourceVaultProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal PrepareDataMoveResponseSourceVaultProperties(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpoint.cs new file mode 100644 index 000000000000..2a2616382497 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpoint.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// The Private Endpoint network resource that is linked to the Private Endpoint connection + /// + public partial class PrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointInternal + { + + /// Backing field for property. + private string _id; + + /// Gets or sets id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Creates an new instance. + public PrivateEndpoint() + { + + } + } + /// The Private Endpoint network resource that is linked to the Private Endpoint connection + public partial interface IPrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Gets or sets id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets id", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + } + /// The Private Endpoint network resource that is linked to the Private Endpoint connection + internal partial interface IPrivateEndpointInternal + + { + /// Gets or sets id + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpoint.json.cs new file mode 100644 index 000000000000..3429b4c1457c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpoint.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// The Private Endpoint network resource that is linked to the Private Endpoint connection + /// + public partial class PrivateEndpoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PrivateEndpoint(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnection.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..376a46bdc9bd --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnection.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Private Endpoint Connection Response Properties + public partial class PrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnection, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal + { + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateEndpoint()); set { {_privateEndpoint = value;} } } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpoint _privateEndpoint; + + /// Gets or sets private endpoint associated with the private endpoint connection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateEndpoint()); set => this._privateEndpoint = value; } + + /// Gets or sets id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointInternal)PrivateEndpoint).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; + + /// Gets or sets private link service connection state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } + + /// Gets or sets actions required + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionRequired = value ?? null; } + + /// Gets or sets description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } + + /// Gets or sets the status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState? _provisioningState; + + /// Gets or sets provisioning state of the private endpoint connection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } + + /// Creates an new instance. + public PrivateEndpointConnection() + { + + } + } + /// Private Endpoint Connection Response Properties + public partial interface IPrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Gets or sets id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets id", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; set; } + /// Gets or sets actions required + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets actions required", + SerializedName = @"actionRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionRequired { get; set; } + /// Gets or sets description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// Gets or sets the status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the status", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// Gets or sets provisioning state of the private endpoint connection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets provisioning state of the private endpoint connection", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState? ProvisioningState { get; set; } + + } + /// Private Endpoint Connection Response Properties + internal partial interface IPrivateEndpointConnectionInternal + + { + /// Gets or sets private endpoint associated with the private endpoint connection + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpoint PrivateEndpoint { get; set; } + /// Gets or sets id + string PrivateEndpointId { get; set; } + /// Gets or sets private link service connection state + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// Gets or sets actions required + string PrivateLinkServiceConnectionStateActionRequired { get; set; } + /// Gets or sets description + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// Gets or sets the status + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// Gets or sets provisioning state of the private endpoint connection + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnection.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnection.json.cs new file mode 100644 index 000000000000..0a90cc3036fe --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnection.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Private Endpoint Connection Response Properties + public partial class PrivateEndpointConnection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PrivateEndpointConnection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnection(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : PrivateEndpoint;} + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : PrivateLinkServiceConnectionState;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null,serializationMode) : null, "privateEndpoint" ,container.Add ); + AddIf( null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null,serializationMode) : null, "privateLinkServiceConnectionState" ,container.Add ); + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnectionResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..7796b96adbfe --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnectionResource.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Private Endpoint Connection Response Properties + public partial class PrivateEndpointConnectionResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResourceInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateEndpoint = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResourceInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateLinkServiceConnectionState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnection Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateEndpointConnection()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Gets or sets id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateEndpointId = value ?? null; } + + /// Gets or sets actions required + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateLinkServiceConnectionStateActionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateLinkServiceConnectionStateActionRequired = value ?? null; } + + /// Gets or sets description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } + + /// Gets or sets the status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnection _property; + + /// PrivateEndpointConnectionResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnection Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateEndpointConnection()); set => this._property = value; } + + /// Gets or sets provisioning state of the private endpoint connection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionInternal)Property).ProvisioningState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public PrivateEndpointConnectionResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Private Endpoint Connection Response Properties + public partial interface IPrivateEndpointConnectionResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Gets or sets id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets id", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; set; } + /// Gets or sets actions required + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets actions required", + SerializedName = @"actionRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionRequired { get; set; } + /// Gets or sets description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// Gets or sets the status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the status", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// Gets or sets provisioning state of the private endpoint connection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets provisioning state of the private endpoint connection", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState? ProvisioningState { get; set; } + + } + /// Private Endpoint Connection Response Properties + internal partial interface IPrivateEndpointConnectionResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Gets or sets private endpoint associated with the private endpoint connection + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpoint PrivateEndpoint { get; set; } + /// Gets or sets id + string PrivateEndpointId { get; set; } + /// Gets or sets private link service connection state + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// Gets or sets actions required + string PrivateLinkServiceConnectionStateActionRequired { get; set; } + /// Gets or sets description + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// Gets or sets the status + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// PrivateEndpointConnectionResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnection Property { get; set; } + /// Gets or sets provisioning state of the private endpoint connection + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnectionResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnectionResource.json.cs new file mode 100644 index 000000000000..16faf20a87a8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateEndpointConnectionResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Private Endpoint Connection Response Properties + public partial class PrivateEndpointConnectionResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateEndpointConnection.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateLinkServiceConnectionState.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..dd6050c3b270 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateLinkServiceConnectionState.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Private Link Service Connection State + public partial class PrivateLinkServiceConnectionState : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionState, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionStateInternal + { + + /// Backing field for property. + private string _actionRequired; + + /// Gets or sets actions required + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ActionRequired { get => this._actionRequired; set => this._actionRequired = value; } + + /// Backing field for property. + private string _description; + + /// Gets or sets description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus? _status; + + /// Gets or sets the status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public PrivateLinkServiceConnectionState() + { + + } + } + /// Private Link Service Connection State + public partial interface IPrivateLinkServiceConnectionState : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Gets or sets actions required + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets actions required", + SerializedName = @"actionRequired", + PossibleTypes = new [] { typeof(string) })] + string ActionRequired { get; set; } + /// Gets or sets description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Gets or sets the status + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the status", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus? Status { get; set; } + + } + /// Private Link Service Connection State + internal partial interface IPrivateLinkServiceConnectionStateInternal + + { + /// Gets or sets actions required + string ActionRequired { get; set; } + /// Gets or sets description + string Description { get; set; } + /// Gets or sets the status + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateLinkServiceConnectionState.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateLinkServiceConnectionState.json.cs new file mode 100644 index 000000000000..67b0224b3786 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/PrivateLinkServiceConnectionState.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Private Link Service Connection State + public partial class PrivateLinkServiceConnectionState + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionState. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionState. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateLinkServiceConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new PrivateLinkServiceConnectionState(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkServiceConnectionState(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_actionRequired = If( json?.PropertyT("actionRequired"), out var __jsonActionRequired) ? (string)__jsonActionRequired : (string)ActionRequired;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._actionRequired)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._actionRequired.ToString()) : null, "actionRequired" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainer.cs new file mode 100644 index 000000000000..87f3e9366356 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainer.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Protectable Container Class. + public partial class ProtectableContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private string _containerId; + + /// Fabric Id of the container such as ARM Id. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerId { get => this._containerId; set => this._containerId = value; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Backing field for property. + private string _healthStatus; + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string HealthStatus { get => this._healthStatus; set => this._healthStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType _type; + + /// + /// Type of the container. The value of this property for + /// 1. Compute Azure VM is Microsoft.Compute/virtualMachines + /// 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ProtectableContainer() + { + + } + } + /// Protectable Container Class. + public partial interface IProtectableContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the container.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Fabric Id of the container such as ARM Id. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fabric Id of the container such as ARM Id.", + SerializedName = @"containerId", + PossibleTypes = new [] { typeof(string) })] + string ContainerId { get; set; } + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the container.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of health of the container.", + SerializedName = @"healthStatus", + PossibleTypes = new [] { typeof(string) })] + string HealthStatus { get; set; } + /// + /// Type of the container. The value of this property for + /// 1. Compute Azure VM is Microsoft.Compute/virtualMachines + /// 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the container. The value of this property for + 1. Compute Azure VM is Microsoft.Compute/virtualMachines + 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines", + SerializedName = @"protectableContainerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType Type { get; set; } + + } + /// Protectable Container Class. + internal partial interface IProtectableContainerInternal + + { + /// Type of backup management for the container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Fabric Id of the container such as ARM Id. + string ContainerId { get; set; } + /// Friendly name of the container. + string FriendlyName { get; set; } + /// Status of health of the container. + string HealthStatus { get; set; } + /// + /// Type of the container. The value of this property for + /// 1. Compute Azure VM is Microsoft.Compute/virtualMachines + /// 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainer.json.cs new file mode 100644 index 000000000000..0f17c290fa31 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainer.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Protectable Container Class. + public partial class ProtectableContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("protectableContainerType") ) + { + case "StorageContainer": + { + return new AzureStorageProtectableContainer(json); + } + case "VMAppContainer": + { + return new AzureVMAppContainerProtectableContainer(json); + } + } + return new ProtectableContainer(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectableContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_type = If( json?.PropertyT("protectableContainerType"), out var __jsonProtectableContainerType) ? (string)__jsonProtectableContainerType : (string)Type;} + {_healthStatus = If( json?.PropertyT("healthStatus"), out var __jsonHealthStatus) ? (string)__jsonHealthStatus : (string)HealthStatus;} + {_containerId = If( json?.PropertyT("containerId"), out var __jsonContainerId) ? (string)__jsonContainerId : (string)ContainerId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "protectableContainerType" ,container.Add ); + AddIf( null != (((object)this._healthStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._healthStatus.ToString()) : null, "healthStatus" ,container.Add ); + AddIf( null != (((object)this._containerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerId.ToString()) : null, "containerId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResource.cs new file mode 100644 index 000000000000..55cc0d19e5ae --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResource.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Protectable Container Class. + public partial class ProtectableContainerResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)Property).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Fabric Id of the container such as ARM Id. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)Property).ContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)Property).ContainerId = value ?? null; } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)Property).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)Property).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)Property).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)Property).HealthStatus = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectableContainer()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer _property; + + /// ProtectableContainerResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectableContainer()); set => this._property = value; } + + /// + /// Type of the container. The value of this property for + /// 1. Compute Azure VM is Microsoft.Compute/virtualMachines + /// 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType? ProtectableContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ProtectableContainerResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Protectable Container Class. + public partial interface IProtectableContainerResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the container.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Fabric Id of the container such as ARM Id. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fabric Id of the container such as ARM Id.", + SerializedName = @"containerId", + PossibleTypes = new [] { typeof(string) })] + string ContainerId { get; set; } + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the container.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of health of the container.", + SerializedName = @"healthStatus", + PossibleTypes = new [] { typeof(string) })] + string HealthStatus { get; set; } + /// + /// Type of the container. The value of this property for + /// 1. Compute Azure VM is Microsoft.Compute/virtualMachines + /// 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the container. The value of this property for + 1. Compute Azure VM is Microsoft.Compute/virtualMachines + 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines", + SerializedName = @"protectableContainerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType? ProtectableContainerType { get; set; } + + } + /// Protectable Container Class. + internal partial interface IProtectableContainerResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Type of backup management for the container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Fabric Id of the container such as ARM Id. + string ContainerId { get; set; } + /// Friendly name of the container. + string FriendlyName { get; set; } + /// Status of health of the container. + string HealthStatus { get; set; } + /// ProtectableContainerResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainer Property { get; set; } + /// + /// Type of the container. The value of this property for + /// 1. Compute Azure VM is Microsoft.Compute/virtualMachines + /// 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType? ProtectableContainerType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResource.json.cs new file mode 100644 index 000000000000..797cbfa5ffe2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Protectable Container Class. + public partial class ProtectableContainerResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectableContainerResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectableContainerResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectableContainer.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResourceList.cs new file mode 100644 index 000000000000..034cd2581fca --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectableContainer resources + public partial class ProtectableContainerResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ProtectableContainerResourceList() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + } + /// List of ProtectableContainer resources + public partial interface IProtectableContainerResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResource[] Value { get; set; } + + } + /// List of ProtectableContainer resources + internal partial interface IProtectableContainerResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResourceList.json.cs new file mode 100644 index 000000000000..67375deec7a0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectableContainerResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectableContainer resources + public partial class ProtectableContainerResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectableContainerResourceList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectableContainerResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectableContainerResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectableContainerResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItem.cs new file mode 100644 index 000000000000..6f028b3f9074 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup items. + public partial class ProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private string _backupSetName; + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupSetName { get => this._backupSetName; set => this._backupSetName = value; } + + /// Backing field for property. + private string _containerName; + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? _createMode; + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => this._createMode; set => this._createMode = value; } + + /// Backing field for property. + private global::System.DateTime? _deferredDeleteTimeInUtc; + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => this._deferredDeleteTimeInUtc; set => this._deferredDeleteTimeInUtc = value; } + + /// Backing field for property. + private string _deferredDeleteTimeRemaining; + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DeferredDeleteTimeRemaining { get => this._deferredDeleteTimeRemaining; set => this._deferredDeleteTimeRemaining = value; } + + /// Backing field for property. + private bool? _isArchiveEnabled; + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsArchiveEnabled { get => this._isArchiveEnabled; set => this._isArchiveEnabled = value; } + + /// Backing field for property. + private bool? _isDeferredDeleteScheduleUpcoming; + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsDeferredDeleteScheduleUpcoming { get => this._isDeferredDeleteScheduleUpcoming; set => this._isDeferredDeleteScheduleUpcoming = value; } + + /// Backing field for property. + private bool? _isRehydrate; + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsRehydrate { get => this._isRehydrate; set => this._isRehydrate = value; } + + /// Backing field for property. + private bool? _isScheduledForDeferredDelete; + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsScheduledForDeferredDelete { get => this._isScheduledForDeferredDelete; set => this._isScheduledForDeferredDelete = value; } + + /// Backing field for property. + private global::System.DateTime? _lastRecoveryPoint; + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime? LastRecoveryPoint { get => this._lastRecoveryPoint; set => this._lastRecoveryPoint = value; } + + /// Backing field for property. + private string _policyId; + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyId { get => this._policyId; set => this._policyId = value; } + + /// Backing field for property. + private string _policyName; + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyName { get => this._policyName; set => this._policyName = value; } + + /// Backing field for property. + private string[] _resourceGuardOperationRequest; + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] ResourceGuardOperationRequest { get => this._resourceGuardOperationRequest; set => this._resourceGuardOperationRequest = value; } + + /// Backing field for property. + private string _sourceResourceId; + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Backing field for property. + private string _type; + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? _workloadType; + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public ProtectedItem() + { + + } + } + /// Base class for backup items. + public partial interface IProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the backed up item.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the backup set the backup item belongs to", + SerializedName = @"backupSetName", + PossibleTypes = new [] { typeof(string) })] + string BackupSetName { get; set; } + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique name of container", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Create mode to indicate recovery of existing soft deleted data source or creation of new data source.", + SerializedName = @"createMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get; set; } + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time for deferred deletion in UTC", + SerializedName = @"deferredDeleteTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeferredDeleteTimeInUtc { get; set; } + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time remaining before the DS marked for deferred delete is permanently deleted", + SerializedName = @"deferredDeleteTimeRemaining", + PossibleTypes = new [] { typeof(string) })] + string DeferredDeleteTimeRemaining { get; set; } + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to identify whether datasource is protected in archive", + SerializedName = @"isArchiveEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsArchiveEnabled { get; set; } + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to identify whether the deferred deleted DS is to be purged soon", + SerializedName = @"isDeferredDeleteScheduleUpcoming", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDeferredDeleteScheduleUpcoming { get; set; } + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to identify that deferred deleted DS is to be moved into Pause state", + SerializedName = @"isRehydrate", + PossibleTypes = new [] { typeof(bool) })] + bool? IsRehydrate { get; set; } + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to identify whether the DS is scheduled for deferred delete", + SerializedName = @"isScheduledForDeferredDelete", + PossibleTypes = new [] { typeof(bool) })] + bool? IsScheduledForDeferredDelete { get; set; } + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Timestamp when the last (latest) backup copy was created for this backup item.", + SerializedName = @"lastRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRecoveryPoint { get; set; } + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the backup policy with which this item is backed up.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + string PolicyId { get; set; } + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the policy used for protection", + SerializedName = @"policyName", + PossibleTypes = new [] { typeof(string) })] + string PolicyName { get; set; } + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ResourceGuardOperationRequests on which LAC check will be performed", + SerializedName = @"resourceGuardOperationRequests", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceGuardOperationRequest { get; set; } + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the resource to be backed up.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"backup item type.", + SerializedName = @"protectedItemType", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of workload this item represents.", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get; set; } + + } + /// Base class for backup items. + internal partial interface IProtectedItemInternal + + { + /// Type of backup management for the backed up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Name of the backup set the backup item belongs to + string BackupSetName { get; set; } + /// Unique name of container + string ContainerName { get; set; } + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get; set; } + /// Time for deferred deletion in UTC + global::System.DateTime? DeferredDeleteTimeInUtc { get; set; } + /// Time remaining before the DS marked for deferred delete is permanently deleted + string DeferredDeleteTimeRemaining { get; set; } + /// Flag to identify whether datasource is protected in archive + bool? IsArchiveEnabled { get; set; } + /// Flag to identify whether the deferred deleted DS is to be purged soon + bool? IsDeferredDeleteScheduleUpcoming { get; set; } + /// Flag to identify that deferred deleted DS is to be moved into Pause state + bool? IsRehydrate { get; set; } + /// Flag to identify whether the DS is scheduled for deferred delete + bool? IsScheduledForDeferredDelete { get; set; } + /// Timestamp when the last (latest) backup copy was created for this backup item. + global::System.DateTime? LastRecoveryPoint { get; set; } + /// ID of the backup policy with which this item is backed up. + string PolicyId { get; set; } + /// Name of the policy used for protection + string PolicyName { get; set; } + /// ResourceGuardOperationRequests on which LAC check will be performed + string[] ResourceGuardOperationRequest { get; set; } + /// ARM ID of the resource to be backed up. + string SourceResourceId { get; set; } + /// backup item type. + string Type { get; set; } + /// Type of workload this item represents. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItem.json.cs new file mode 100644 index 000000000000..0b8d2d2d8767 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItem.json.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup items. + public partial class ProtectedItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("protectedItemType") ) + { + case "AzureFileShareProtectedItem": + { + return new AzureFileshareProtectedItem(json); + } + case "AzureIaaSVMProtectedItem": + { + return new AzureIaaSvmProtectedItem(json); + } + case "Microsoft.ClassicCompute/virtualMachines": + { + return new AzureIaaSClassicComputeVmprotectedItem(json); + } + case "Microsoft.Compute/virtualMachines": + { + return new AzureIaaSComputeVmprotectedItem(json); + } + case "Microsoft.Sql/servers/databases": + { + return new AzureSqlProtectedItem(json); + } + case "AzureVmWorkloadProtectedItem": + { + return new AzureVMWorkloadProtectedItem(json); + } + case "AzureVmWorkloadSAPAseDatabase": + { + return new AzureVMWorkloadSapAseDatabaseProtectedItem(json); + } + case "AzureVmWorkloadSAPHanaDatabase": + { + return new AzureVMWorkloadSapHanaDatabaseProtectedItem(json); + } + case "AzureVmWorkloadSQLDatabase": + { + return new AzureVMWorkloadSqlDatabaseProtectedItem(json); + } + case "DPMProtectedItem": + { + return new DpmProtectedItem(json); + } + case "GenericProtectedItem": + { + return new GenericProtectedItem(json); + } + case "MabFileFolderProtectedItem": + { + return new MabFileFolderProtectedItem(json); + } + } + return new ProtectedItem(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectedItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("protectedItemType"), out var __jsonProtectedItemType) ? (string)__jsonProtectedItemType : (string)Type;} + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + {_policyId = If( json?.PropertyT("policyId"), out var __jsonPolicyId) ? (string)__jsonPolicyId : (string)PolicyId;} + {_lastRecoveryPoint = If( json?.PropertyT("lastRecoveryPoint"), out var __jsonLastRecoveryPoint) ? global::System.DateTime.TryParse((string)__jsonLastRecoveryPoint, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastRecoveryPointValue) ? __jsonLastRecoveryPointValue : LastRecoveryPoint : LastRecoveryPoint;} + {_backupSetName = If( json?.PropertyT("backupSetName"), out var __jsonBackupSetName) ? (string)__jsonBackupSetName : (string)BackupSetName;} + {_createMode = If( json?.PropertyT("createMode"), out var __jsonCreateMode) ? (string)__jsonCreateMode : (string)CreateMode;} + {_deferredDeleteTimeInUtc = If( json?.PropertyT("deferredDeleteTimeInUTC"), out var __jsonDeferredDeleteTimeInUtc) ? global::System.DateTime.TryParse((string)__jsonDeferredDeleteTimeInUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDeferredDeleteTimeInUtcValue) ? __jsonDeferredDeleteTimeInUtcValue : DeferredDeleteTimeInUtc : DeferredDeleteTimeInUtc;} + {_isScheduledForDeferredDelete = If( json?.PropertyT("isScheduledForDeferredDelete"), out var __jsonIsScheduledForDeferredDelete) ? (bool?)__jsonIsScheduledForDeferredDelete : IsScheduledForDeferredDelete;} + {_deferredDeleteTimeRemaining = If( json?.PropertyT("deferredDeleteTimeRemaining"), out var __jsonDeferredDeleteTimeRemaining) ? (string)__jsonDeferredDeleteTimeRemaining : (string)DeferredDeleteTimeRemaining;} + {_isDeferredDeleteScheduleUpcoming = If( json?.PropertyT("isDeferredDeleteScheduleUpcoming"), out var __jsonIsDeferredDeleteScheduleUpcoming) ? (bool?)__jsonIsDeferredDeleteScheduleUpcoming : IsDeferredDeleteScheduleUpcoming;} + {_isRehydrate = If( json?.PropertyT("isRehydrate"), out var __jsonIsRehydrate) ? (bool?)__jsonIsRehydrate : IsRehydrate;} + {_resourceGuardOperationRequest = If( json?.PropertyT("resourceGuardOperationRequests"), out var __jsonResourceGuardOperationRequests) ? If( __jsonResourceGuardOperationRequests as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ResourceGuardOperationRequest;} + {_isArchiveEnabled = If( json?.PropertyT("isArchiveEnabled"), out var __jsonIsArchiveEnabled) ? (bool?)__jsonIsArchiveEnabled : IsArchiveEnabled;} + {_policyName = If( json?.PropertyT("policyName"), out var __jsonPolicyName) ? (string)__jsonPolicyName : (string)PolicyName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "protectedItemType" ,container.Add ); + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + AddIf( null != (((object)this._policyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyId.ToString()) : null, "policyId" ,container.Add ); + AddIf( null != this._lastRecoveryPoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastRecoveryPoint?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastRecoveryPoint" ,container.Add ); + AddIf( null != (((object)this._backupSetName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupSetName.ToString()) : null, "backupSetName" ,container.Add ); + AddIf( null != (((object)this._createMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._createMode.ToString()) : null, "createMode" ,container.Add ); + AddIf( null != this._deferredDeleteTimeInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._deferredDeleteTimeInUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "deferredDeleteTimeInUTC" ,container.Add ); + AddIf( null != this._isScheduledForDeferredDelete ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isScheduledForDeferredDelete) : null, "isScheduledForDeferredDelete" ,container.Add ); + AddIf( null != (((object)this._deferredDeleteTimeRemaining)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._deferredDeleteTimeRemaining.ToString()) : null, "deferredDeleteTimeRemaining" ,container.Add ); + AddIf( null != this._isDeferredDeleteScheduleUpcoming ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isDeferredDeleteScheduleUpcoming) : null, "isDeferredDeleteScheduleUpcoming" ,container.Add ); + AddIf( null != this._isRehydrate ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isRehydrate) : null, "isRehydrate" ,container.Add ); + if (null != this._resourceGuardOperationRequest) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._resourceGuardOperationRequest ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("resourceGuardOperationRequests",__w); + } + AddIf( null != this._isArchiveEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isArchiveEnabled) : null, "isArchiveEnabled" ,container.Add ); + AddIf( null != (((object)this._policyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyName.ToString()) : null, "policyName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemQueryObject.cs new file mode 100644 index 000000000000..16480b34779a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemQueryObject.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list backup items. + public partial class ProtectedItemQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemQueryObjectInternal + { + + /// Backing field for property. + private string _backupEngineName; + + /// Backup Engine name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupEngineName { get => this._backupEngineName; set => this._backupEngineName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Backup management type for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private string _backupSetName; + + /// Name of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupSetName { get => this._backupSetName; set => this._backupSetName = value; } + + /// Backing field for property. + private string _containerName; + + /// Name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private string _fabricName; + + /// Name of the fabric. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of protected item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState? _healthState; + + /// Health State for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState? HealthState { get => this._healthState; set => this._healthState = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? _itemType; + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? ItemType { get => this._itemType; set => this._itemType = value; } + + /// Backing field for property. + private string _policyName; + + /// Backup policy name associated with the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyName { get => this._policyName; set => this._policyName = value; } + + /// Creates an new instance. + public ProtectedItemQueryObject() + { + + } + } + /// Filters to list backup items. + public partial interface IProtectedItemQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup Engine name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup Engine name", + SerializedName = @"backupEngineName", + PossibleTypes = new [] { typeof(string) })] + string BackupEngineName { get; set; } + /// Backup management type for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type for the backed up item.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Name of the backup set. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the backup set.", + SerializedName = @"backupSetName", + PossibleTypes = new [] { typeof(string) })] + string BackupSetName { get; set; } + /// Name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the container.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Name of the fabric. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the fabric.", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + string FabricName { get; set; } + /// Friendly name of protected item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of protected item", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Health State for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Health State for the backed up item.", + SerializedName = @"healthState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState? HealthState { get; set; } + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of workload this item represents.", + SerializedName = @"itemType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? ItemType { get; set; } + /// Backup policy name associated with the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup policy name associated with the backup item.", + SerializedName = @"policyName", + PossibleTypes = new [] { typeof(string) })] + string PolicyName { get; set; } + + } + /// Filters to list backup items. + internal partial interface IProtectedItemQueryObjectInternal + + { + /// Backup Engine name + string BackupEngineName { get; set; } + /// Backup management type for the backed up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Name of the backup set. + string BackupSetName { get; set; } + /// Name of the container. + string ContainerName { get; set; } + /// Name of the fabric. + string FabricName { get; set; } + /// Friendly name of protected item + string FriendlyName { get; set; } + /// Health State for the backed up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState? HealthState { get; set; } + /// Type of workload this item represents. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? ItemType { get; set; } + /// Backup policy name associated with the backup item. + string PolicyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemQueryObject.json.cs new file mode 100644 index 000000000000..676e871ab514 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list backup items. + public partial class ProtectedItemQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectedItemQueryObject(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectedItemQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_healthState = If( json?.PropertyT("healthState"), out var __jsonHealthState) ? (string)__jsonHealthState : (string)HealthState;} + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_itemType = If( json?.PropertyT("itemType"), out var __jsonItemType) ? (string)__jsonItemType : (string)ItemType;} + {_policyName = If( json?.PropertyT("policyName"), out var __jsonPolicyName) ? (string)__jsonPolicyName : (string)PolicyName;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_backupEngineName = If( json?.PropertyT("backupEngineName"), out var __jsonBackupEngineName) ? (string)__jsonBackupEngineName : (string)BackupEngineName;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_fabricName = If( json?.PropertyT("fabricName"), out var __jsonFabricName) ? (string)__jsonFabricName : (string)FabricName;} + {_backupSetName = If( json?.PropertyT("backupSetName"), out var __jsonBackupSetName) ? (string)__jsonBackupSetName : (string)BackupSetName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._healthState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._healthState.ToString()) : null, "healthState" ,container.Add ); + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._itemType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._itemType.ToString()) : null, "itemType" ,container.Add ); + AddIf( null != (((object)this._policyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyName.ToString()) : null, "policyName" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._backupEngineName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupEngineName.ToString()) : null, "backupEngineName" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._fabricName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._fabricName.ToString()) : null, "fabricName" ,container.Add ); + AddIf( null != (((object)this._backupSetName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupSetName.ToString()) : null, "backupSetName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResource.cs new file mode 100644 index 000000000000..cc16b1840520 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResource.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup items. + public partial class ProtectedItemResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BackupSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).BackupSetName = value ?? null; } + + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).ContainerName = value ?? null; } + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).CreateMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode)""); } + + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? DeferredDeleteTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).DeferredDeleteTimeInUtc = value ?? default(global::System.DateTime); } + + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string DeferredDeleteTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).DeferredDeleteTimeRemaining = value ?? null; } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? IsArchiveEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).IsArchiveEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).IsArchiveEnabled = value ?? default(bool); } + + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? IsDeferredDeleteScheduleUpcoming { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).IsDeferredDeleteScheduleUpcoming = value ?? default(bool); } + + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? IsRehydrate { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).IsRehydrate = value ?? default(bool); } + + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? IsScheduledForDeferredDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? LastRecoveryPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).PolicyId = value ?? null; } + + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).PolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).PolicyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem _property; + + /// ProtectedItemResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem()); set => this._property = value; } + + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ProtectedItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).Type = value ?? null; } + + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).SourceResourceId = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemInternal)Property).WorkloadType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType)""); } + + /// Creates an new instance. + public ProtectedItemResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Base class for backup items. + public partial interface IProtectedItemResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the backed up item.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Name of the backup set the backup item belongs to + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the backup set the backup item belongs to", + SerializedName = @"backupSetName", + PossibleTypes = new [] { typeof(string) })] + string BackupSetName { get; set; } + /// Unique name of container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique name of container", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Create mode to indicate recovery of existing soft deleted data source or creation of new data source.", + SerializedName = @"createMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get; set; } + /// Time for deferred deletion in UTC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time for deferred deletion in UTC", + SerializedName = @"deferredDeleteTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeferredDeleteTimeInUtc { get; set; } + /// Time remaining before the DS marked for deferred delete is permanently deleted + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time remaining before the DS marked for deferred delete is permanently deleted", + SerializedName = @"deferredDeleteTimeRemaining", + PossibleTypes = new [] { typeof(string) })] + string DeferredDeleteTimeRemaining { get; set; } + /// Flag to identify whether datasource is protected in archive + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to identify whether datasource is protected in archive", + SerializedName = @"isArchiveEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsArchiveEnabled { get; set; } + /// Flag to identify whether the deferred deleted DS is to be purged soon + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to identify whether the deferred deleted DS is to be purged soon", + SerializedName = @"isDeferredDeleteScheduleUpcoming", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDeferredDeleteScheduleUpcoming { get; set; } + /// Flag to identify that deferred deleted DS is to be moved into Pause state + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to identify that deferred deleted DS is to be moved into Pause state", + SerializedName = @"isRehydrate", + PossibleTypes = new [] { typeof(bool) })] + bool? IsRehydrate { get; set; } + /// Flag to identify whether the DS is scheduled for deferred delete + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to identify whether the DS is scheduled for deferred delete", + SerializedName = @"isScheduledForDeferredDelete", + PossibleTypes = new [] { typeof(bool) })] + bool? IsScheduledForDeferredDelete { get; set; } + /// Timestamp when the last (latest) backup copy was created for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Timestamp when the last (latest) backup copy was created for this backup item.", + SerializedName = @"lastRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRecoveryPoint { get; set; } + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the backup policy with which this item is backed up.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + string PolicyId { get; set; } + /// Name of the policy used for protection + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the policy used for protection", + SerializedName = @"policyName", + PossibleTypes = new [] { typeof(string) })] + string PolicyName { get; set; } + /// backup item type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"backup item type.", + SerializedName = @"protectedItemType", + PossibleTypes = new [] { typeof(string) })] + string ProtectedItemType { get; set; } + /// ResourceGuardOperationRequests on which LAC check will be performed + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ResourceGuardOperationRequests on which LAC check will be performed", + SerializedName = @"resourceGuardOperationRequests", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceGuardOperationRequest { get; set; } + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the resource to be backed up.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + /// Type of workload this item represents. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of workload this item represents.", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get; set; } + + } + /// Base class for backup items. + internal partial interface IProtectedItemResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Type of backup management for the backed up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Name of the backup set the backup item belongs to + string BackupSetName { get; set; } + /// Unique name of container + string ContainerName { get; set; } + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode? CreateMode { get; set; } + /// Time for deferred deletion in UTC + global::System.DateTime? DeferredDeleteTimeInUtc { get; set; } + /// Time remaining before the DS marked for deferred delete is permanently deleted + string DeferredDeleteTimeRemaining { get; set; } + /// Flag to identify whether datasource is protected in archive + bool? IsArchiveEnabled { get; set; } + /// Flag to identify whether the deferred deleted DS is to be purged soon + bool? IsDeferredDeleteScheduleUpcoming { get; set; } + /// Flag to identify that deferred deleted DS is to be moved into Pause state + bool? IsRehydrate { get; set; } + /// Flag to identify whether the DS is scheduled for deferred delete + bool? IsScheduledForDeferredDelete { get; set; } + /// Timestamp when the last (latest) backup copy was created for this backup item. + global::System.DateTime? LastRecoveryPoint { get; set; } + /// ID of the backup policy with which this item is backed up. + string PolicyId { get; set; } + /// Name of the policy used for protection + string PolicyName { get; set; } + /// ProtectedItemResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItem Property { get; set; } + /// backup item type. + string ProtectedItemType { get; set; } + /// ResourceGuardOperationRequests on which LAC check will be performed + string[] ResourceGuardOperationRequest { get; set; } + /// ARM ID of the resource to be backed up. + string SourceResourceId { get; set; } + /// Type of workload this item represents. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType? WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResource.json.cs new file mode 100644 index 000000000000..289201685bb1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup items. + public partial class ProtectedItemResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectedItemResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectedItemResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItem.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResourceList.cs new file mode 100644 index 000000000000..be907be9ce1f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectedItem resources + public partial class ProtectedItemResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ProtectedItemResourceList() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + } + /// List of ProtectedItem resources + public partial interface IProtectedItemResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource[] Value { get; set; } + + } + /// List of ProtectedItem resources + internal partial interface IProtectedItemResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResourceList.json.cs new file mode 100644 index 000000000000..7bce280f885b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectedItemResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectedItem resources + public partial class ProtectedItemResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectedItemResourceList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectedItemResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItemResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainer.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainer.cs new file mode 100644 index 000000000000..7aa4d4fe4fc8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainer.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for container with backup items. Containers with specific workloads are derived from this class. + /// + public partial class ProtectionContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType _containerType; + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get => this._containerType; set => this._containerType = value; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Backing field for property. + private string _healthStatus; + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string HealthStatus { get => this._healthStatus; set => this._healthStatus = value; } + + /// Backing field for property. + private string _protectableObjectType; + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectableObjectType { get => this._protectableObjectType; set => this._protectableObjectType = value; } + + /// Backing field for property. + private string _registrationStatus; + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RegistrationStatus { get => this._registrationStatus; set => this._registrationStatus = value; } + + /// Creates an new instance. + public ProtectionContainer() + { + + } + } + /// Base class for container with backup items. Containers with specific workloads are derived from this class. + public partial interface IProtectionContainer : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the container.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + Backup is VMAppContainer", + SerializedName = @"containerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get; set; } + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the container.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of health of the container.", + SerializedName = @"healthStatus", + PossibleTypes = new [] { typeof(string) })] + string HealthStatus { get; set; } + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the protectable object associated with this container", + SerializedName = @"protectableObjectType", + PossibleTypes = new [] { typeof(string) })] + string ProtectableObjectType { get; set; } + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of registration of the container with the Recovery Services Vault.", + SerializedName = @"registrationStatus", + PossibleTypes = new [] { typeof(string) })] + string RegistrationStatus { get; set; } + + } + /// Base class for container with backup items. Containers with specific workloads are derived from this class. + internal partial interface IProtectionContainerInternal + + { + /// Type of backup management for the container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType ContainerType { get; set; } + /// Friendly name of the container. + string FriendlyName { get; set; } + /// Status of health of the container. + string HealthStatus { get; set; } + /// Type of the protectable object associated with this container + string ProtectableObjectType { get; set; } + /// Status of registration of the container with the Recovery Services Vault. + string RegistrationStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainer.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainer.json.cs new file mode 100644 index 000000000000..3d5e29c8afda --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainer.json.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for container with backup items. Containers with specific workloads are derived from this class. + /// + public partial class ProtectionContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("containerType") ) + { + case "DPMContainer": + { + return new DpmContainer(json); + } + case "AzureBackupServerContainer": + { + return new AzureBackupServerContainer(json); + } + case "IaasVMContainer": + { + return new IaaSvmContainer(json); + } + case "Microsoft.ClassicCompute/virtualMachines": + { + return new AzureIaaSClassicComputeVmcontainer(json); + } + case "Microsoft.Compute/virtualMachines": + { + return new AzureIaaSComputeVmcontainer(json); + } + case "AzureWorkloadContainer": + { + return new AzureWorkloadContainer(json); + } + case "SQLAGWorkLoadContainer": + { + return new AzureSqlagWorkloadContainerProtectionContainer(json); + } + case "AzureSqlContainer": + { + return new AzureSqlContainer(json); + } + case "StorageContainer": + { + return new AzureStorageContainer(json); + } + case "VMAppContainer": + { + return new AzureVMAppContainerProtectionContainer(json); + } + case "GenericContainer": + { + return new GenericContainer(json); + } + case "Windows": + { + return new MabContainer(json); + } + } + return new ProtectionContainer(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionContainer(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_registrationStatus = If( json?.PropertyT("registrationStatus"), out var __jsonRegistrationStatus) ? (string)__jsonRegistrationStatus : (string)RegistrationStatus;} + {_healthStatus = If( json?.PropertyT("healthStatus"), out var __jsonHealthStatus) ? (string)__jsonHealthStatus : (string)HealthStatus;} + {_containerType = If( json?.PropertyT("containerType"), out var __jsonContainerType) ? (string)__jsonContainerType : (string)ContainerType;} + {_protectableObjectType = If( json?.PropertyT("protectableObjectType"), out var __jsonProtectableObjectType) ? (string)__jsonProtectableObjectType : (string)ProtectableObjectType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._registrationStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._registrationStatus.ToString()) : null, "registrationStatus" ,container.Add ); + AddIf( null != (((object)this._healthStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._healthStatus.ToString()) : null, "healthStatus" ,container.Add ); + AddIf( null != (((object)this._containerType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerType.ToString()) : null, "containerType" ,container.Add ); + AddIf( null != (((object)this._protectableObjectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectableObjectType.ToString()) : null, "protectableObjectType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResource.cs new file mode 100644 index 000000000000..2b671b3c6504 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResource.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for container with backup items. Containers with specific workloads are derived from this class. + /// + public partial class ProtectionContainerResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType? ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).ContainerType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType)""); } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).FriendlyName = value ?? null; } + + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string HealthStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).HealthStatus = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer _property; + + /// ProtectionContainerResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer()); set => this._property = value; } + + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ProtectableObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).ProtectableObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).ProtectableObjectType = value ?? null; } + + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RegistrationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).RegistrationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerInternal)Property).RegistrationStatus = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ProtectionContainerResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Base class for container with backup items. Containers with specific workloads are derived from this class. + public partial interface IProtectionContainerResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Type of backup management for the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the container.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + Backup is VMAppContainer", + SerializedName = @"containerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType? ContainerType { get; set; } + /// Friendly name of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the container.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Status of health of the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of health of the container.", + SerializedName = @"healthStatus", + PossibleTypes = new [] { typeof(string) })] + string HealthStatus { get; set; } + /// Type of the protectable object associated with this container + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the protectable object associated with this container", + SerializedName = @"protectableObjectType", + PossibleTypes = new [] { typeof(string) })] + string ProtectableObjectType { get; set; } + /// Status of registration of the container with the Recovery Services Vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of registration of the container with the Recovery Services Vault.", + SerializedName = @"registrationStatus", + PossibleTypes = new [] { typeof(string) })] + string RegistrationStatus { get; set; } + + } + /// Base class for container with backup items. Containers with specific workloads are derived from this class. + internal partial interface IProtectionContainerResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Type of backup management for the container. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// + /// Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines 2. + /// Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is + /// Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload + /// Backup is VMAppContainer + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType? ContainerType { get; set; } + /// Friendly name of the container. + string FriendlyName { get; set; } + /// Status of health of the container. + string HealthStatus { get; set; } + /// ProtectionContainerResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainer Property { get; set; } + /// Type of the protectable object associated with this container + string ProtectableObjectType { get; set; } + /// Status of registration of the container with the Recovery Services Vault. + string RegistrationStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResource.json.cs new file mode 100644 index 000000000000..be431b9e3fd1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for container with backup items. Containers with specific workloads are derived from this class. + /// + public partial class ProtectionContainerResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectionContainerResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionContainerResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainer.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResourceList.cs new file mode 100644 index 000000000000..5ced8ee91ded --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectionContainer resources + public partial class ProtectionContainerResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ProtectionContainerResourceList() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + } + /// List of ProtectionContainer resources + public partial interface IProtectionContainerResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource[] Value { get; set; } + + } + /// List of ProtectionContainer resources + internal partial interface IProtectionContainerResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResourceList.json.cs new file mode 100644 index 000000000000..ccda2ef59365 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionContainerResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectionContainer resources + public partial class ProtectionContainerResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectionContainerResourceList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionContainerResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainerResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntent.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntent.cs new file mode 100644 index 000000000000..1c90e91cd371 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntent.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup ProtectionIntent. + public partial class ProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private string _itemId; + + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ItemId { get => this._itemId; set => this._itemId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType _itemType; + + /// backup protectionIntent type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType ItemType { get => this._itemType; set => this._itemType = value; } + + /// Backing field for property. + private string _policyId; + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyId { get => this._policyId; set => this._policyId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? _protectionState; + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => this._protectionState; set => this._protectionState = value; } + + /// Backing field for property. + private string _sourceResourceId; + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Creates an new instance. + public ProtectionIntent() + { + + } + } + /// Base class for backup ProtectionIntent. + public partial interface IProtectionIntent : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the backed up item.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId", + SerializedName = @"itemId", + PossibleTypes = new [] { typeof(string) })] + string ItemId { get; set; } + /// backup protectionIntent type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"backup protectionIntent type.", + SerializedName = @"protectionIntentItemType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType ItemType { get; set; } + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the backup policy with which this item is backed up.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + string PolicyId { get; set; } + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup state of this backup item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the resource to be backed up.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + + } + /// Base class for backup ProtectionIntent. + internal partial interface IProtectionIntentInternal + + { + /// Type of backup management for the backed up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + string ItemId { get; set; } + /// backup protectionIntent type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType ItemType { get; set; } + /// ID of the backup policy with which this item is backed up. + string PolicyId { get; set; } + /// Backup state of this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// ARM ID of the resource to be backed up. + string SourceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntent.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntent.json.cs new file mode 100644 index 000000000000..c232a23380ee --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntent.json.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup ProtectionIntent. + public partial class ProtectionIntent + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent interface is + /// polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("protectionIntentItemType") ) + { + case "RecoveryServiceVaultItem": + { + return new AzureRecoveryServiceVaultProtectionIntent(json); + } + case "AzureResourceItem": + { + return new AzureResourceProtectionIntent(json); + } + case "AzureWorkloadContainerAutoProtectionIntent": + { + return new AzureWorkloadContainerAutoProtectionIntent(json); + } + case "AzureWorkloadAutoProtectionIntent": + { + return new AzureWorkloadAutoProtectionIntent(json); + } + case "AzureWorkloadSQLAutoProtectionIntent": + { + return new AzureWorkloadSqlAutoProtectionIntent(json); + } + } + return new ProtectionIntent(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionIntent(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_itemType = If( json?.PropertyT("protectionIntentItemType"), out var __jsonProtectionIntentItemType) ? (string)__jsonProtectionIntentItemType : (string)ItemType;} + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + {_itemId = If( json?.PropertyT("itemId"), out var __jsonItemId) ? (string)__jsonItemId : (string)ItemId;} + {_policyId = If( json?.PropertyT("policyId"), out var __jsonPolicyId) ? (string)__jsonPolicyId : (string)PolicyId;} + {_protectionState = If( json?.PropertyT("protectionState"), out var __jsonProtectionState) ? (string)__jsonProtectionState : (string)ProtectionState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._itemType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._itemType.ToString()) : null, "protectionIntentItemType" ,container.Add ); + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + AddIf( null != (((object)this._itemId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._itemId.ToString()) : null, "itemId" ,container.Add ); + AddIf( null != (((object)this._policyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyId.ToString()) : null, "policyId" ,container.Add ); + AddIf( null != (((object)this._protectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionState.ToString()) : null, "protectionState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentQueryObject.cs new file mode 100644 index 000000000000..44f929b8131a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list protection intent. + public partial class ProtectionIntentQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentQueryObjectInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Backup management type for the backed up item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private string _itemName; + + /// Item name of the intent + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ItemName { get => this._itemName; set => this._itemName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType? _itemType; + + /// Type of workload this item represents + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType? ItemType { get => this._itemType; set => this._itemType = value; } + + /// Backing field for property. + private string _parentName; + + /// Parent name of the intent + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ParentName { get => this._parentName; set => this._parentName = value; } + + /// Creates an new instance. + public ProtectionIntentQueryObject() + { + + } + } + /// Filters to list protection intent. + public partial interface IProtectionIntentQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup management type for the backed up item + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type for the backed up item", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Item name of the intent + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Item name of the intent", + SerializedName = @"itemName", + PossibleTypes = new [] { typeof(string) })] + string ItemName { get; set; } + /// Type of workload this item represents + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of workload this item represents", + SerializedName = @"itemType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType? ItemType { get; set; } + /// Parent name of the intent + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parent name of the intent", + SerializedName = @"parentName", + PossibleTypes = new [] { typeof(string) })] + string ParentName { get; set; } + + } + /// Filters to list protection intent. + internal partial interface IProtectionIntentQueryObjectInternal + + { + /// Backup management type for the backed up item + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Item name of the intent + string ItemName { get; set; } + /// Type of workload this item represents + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType? ItemType { get; set; } + /// Parent name of the intent + string ParentName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentQueryObject.json.cs new file mode 100644 index 000000000000..4ce9698d666c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list protection intent. + public partial class ProtectionIntentQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectionIntentQueryObject(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionIntentQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_itemType = If( json?.PropertyT("itemType"), out var __jsonItemType) ? (string)__jsonItemType : (string)ItemType;} + {_parentName = If( json?.PropertyT("parentName"), out var __jsonParentName) ? (string)__jsonParentName : (string)ParentName;} + {_itemName = If( json?.PropertyT("itemName"), out var __jsonItemName) ? (string)__jsonItemName : (string)ItemName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._itemType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._itemType.ToString()) : null, "itemType" ,container.Add ); + AddIf( null != (((object)this._parentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._parentName.ToString()) : null, "parentName" ,container.Add ); + AddIf( null != (((object)this._itemName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._itemName.ToString()) : null, "itemName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResource.cs new file mode 100644 index 000000000000..f26d94df5ddd --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResource.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup ProtectionIntent. + public partial class ProtectionIntentResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ItemId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).ItemId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).ItemId = value ?? null; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).PolicyId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent _property; + + /// ProtectionIntentResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent()); set => this._property = value; } + + /// backup protectionIntent type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType? ProtectionIntentItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).ItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).ItemType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType)""); } + + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentInternal)Property).SourceResourceId = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ProtectionIntentResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Base class for backup ProtectionIntent. + public partial interface IProtectionIntentResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Type of backup management for the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management for the backed up item.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId", + SerializedName = @"itemId", + PossibleTypes = new [] { typeof(string) })] + string ItemId { get; set; } + /// ID of the backup policy with which this item is backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the backup policy with which this item is backed up.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + string PolicyId { get; set; } + /// backup protectionIntent type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"backup protectionIntent type.", + SerializedName = @"protectionIntentItemType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType? ProtectionIntentItemType { get; set; } + /// Backup state of this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup state of this backup item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// ARM ID of the resource to be backed up. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the resource to be backed up.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + + } + /// Base class for backup ProtectionIntent. + internal partial interface IProtectionIntentResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Type of backup management for the backed up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// + /// ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + /// + string ItemId { get; set; } + /// ID of the backup policy with which this item is backed up. + string PolicyId { get; set; } + /// ProtectionIntentResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntent Property { get; set; } + /// backup protectionIntent type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType? ProtectionIntentItemType { get; set; } + /// Backup state of this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// ARM ID of the resource to be backed up. + string SourceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResource.json.cs new file mode 100644 index 000000000000..e5d911ff9201 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup ProtectionIntent. + public partial class ProtectionIntentResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectionIntentResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionIntentResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntent.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResourceList.cs new file mode 100644 index 000000000000..c276a7292229 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectionIntent resources + public partial class ProtectionIntentResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ProtectionIntentResourceList() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + } + /// List of ProtectionIntent resources + public partial interface IProtectionIntentResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource[] Value { get; set; } + + } + /// List of ProtectionIntent resources + internal partial interface IProtectionIntentResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResourceList.json.cs new file mode 100644 index 000000000000..6436eb0339e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionIntentResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectionIntent resources + public partial class ProtectionIntentResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectionIntentResourceList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionIntentResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntentResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicy.cs new file mode 100644 index 000000000000..14db5a6c909c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup policy. Workload-specific backup policies are derived from this class. + /// + public partial class ProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal + { + + /// Backing field for property. + private string _backupManagementType; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private int? _protectedItemsCount; + + /// Number of items associated with this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? ProtectedItemsCount { get => this._protectedItemsCount; set => this._protectedItemsCount = value; } + + /// Backing field for property. + private string[] _resourceGuardOperationRequest; + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] ResourceGuardOperationRequest { get => this._resourceGuardOperationRequest; set => this._resourceGuardOperationRequest = value; } + + /// Creates an new instance. + public ProtectionPolicy() + { + + } + } + /// Base class for backup policy. Workload-specific backup policies are derived from this class. + public partial interface IProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(string) })] + string BackupManagementType { get; set; } + /// Number of items associated with this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of items associated with this policy.", + SerializedName = @"protectedItemsCount", + PossibleTypes = new [] { typeof(int) })] + int? ProtectedItemsCount { get; set; } + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ResourceGuard Operation Requests", + SerializedName = @"resourceGuardOperationRequests", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceGuardOperationRequest { get; set; } + + } + /// Base class for backup policy. Workload-specific backup policies are derived from this class. + internal partial interface IProtectionPolicyInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string BackupManagementType { get; set; } + /// Number of items associated with this policy. + int? ProtectedItemsCount { get; set; } + /// ResourceGuard Operation Requests + string[] ResourceGuardOperationRequest { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicy.json.cs new file mode 100644 index 000000000000..59d942f913ad --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup policy. Workload-specific backup policies are derived from this class. + /// + public partial class ProtectionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy interface is + /// polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("backupManagementType") ) + { + case "AzureWorkload": + { + return new AzureVMWorkloadProtectionPolicy(json); + } + case "AzureStorage": + { + return new AzureFileShareProtectionPolicy(json); + } + case "AzureIaasVM": + { + return new AzureIaaSvmProtectionPolicy(json); + } + case "AzureSql": + { + return new AzureSqlProtectionPolicy(json); + } + case "GenericProtectionPolicy": + { + return new GenericProtectionPolicy(json); + } + case "MAB": + { + return new MabProtectionPolicy(json); + } + } + return new ProtectionPolicy(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_protectedItemsCount = If( json?.PropertyT("protectedItemsCount"), out var __jsonProtectedItemsCount) ? (int?)__jsonProtectedItemsCount : ProtectedItemsCount;} + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_resourceGuardOperationRequest = If( json?.PropertyT("resourceGuardOperationRequests"), out var __jsonResourceGuardOperationRequests) ? If( __jsonResourceGuardOperationRequests as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ResourceGuardOperationRequest;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._protectedItemsCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._protectedItemsCount) : null, "protectedItemsCount" ,container.Add ); + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + if (null != this._resourceGuardOperationRequest) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._resourceGuardOperationRequest ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("resourceGuardOperationRequests",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyQueryObject.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyQueryObject.cs new file mode 100644 index 000000000000..614544e6735f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyQueryObject.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters the list backup policies API. + public partial class ProtectionPolicyQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyQueryObjectInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? _backupManagementType; + + /// Backup management type for the backup policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private string _fabricName; + + /// Fabric name for filter + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? _workloadType; + + /// Workload type for the backup policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public ProtectionPolicyQueryObject() + { + + } + } + /// Filters the list backup policies API. + public partial interface IProtectionPolicyQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Backup management type for the backup policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup management type for the backup policy.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Fabric name for filter + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fabric name for filter", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + string FabricName { get; set; } + /// Workload type for the backup policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload type for the backup policy.", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } + /// Filters the list backup policies API. + internal partial interface IProtectionPolicyQueryObjectInternal + + { + /// Backup management type for the backup policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + /// Fabric name for filter + string FabricName { get; set; } + /// Workload type for the backup policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType? WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyQueryObject.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyQueryObject.json.cs new file mode 100644 index 000000000000..4f24491245ff --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyQueryObject.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters the list backup policies API. + public partial class ProtectionPolicyQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectionPolicyQueryObject(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionPolicyQueryObject(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_fabricName = If( json?.PropertyT("fabricName"), out var __jsonFabricName) ? (string)__jsonFabricName : (string)FabricName;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._fabricName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._fabricName.ToString()) : null, "fabricName" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResource.cs new file mode 100644 index 000000000000..1132253fefe8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResource.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup policy. Workload-specific backup policies are derived from this class. + /// + public partial class ProtectionPolicyResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)Property).BackupManagementType = value ?? null; } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy _property; + + /// ProtectionPolicyResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy()); set => this._property = value; } + + /// Number of items associated with this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? ProtectedItemsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)Property).ProtectedItemsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)Property).ProtectedItemsCount = value ?? default(int); } + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] ResourceGuardOperationRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)Property).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyInternal)Property).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ProtectionPolicyResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Base class for backup policy. Workload-specific backup policies are derived from this class. + public partial interface IProtectionPolicyResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(string) })] + string BackupManagementType { get; set; } + /// Number of items associated with this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of items associated with this policy.", + SerializedName = @"protectedItemsCount", + PossibleTypes = new [] { typeof(int) })] + int? ProtectedItemsCount { get; set; } + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ResourceGuard Operation Requests", + SerializedName = @"resourceGuardOperationRequests", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceGuardOperationRequest { get; set; } + + } + /// Base class for backup policy. Workload-specific backup policies are derived from this class. + internal partial interface IProtectionPolicyResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string BackupManagementType { get; set; } + /// ProtectionPolicyResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicy Property { get; set; } + /// Number of items associated with this policy. + int? ProtectedItemsCount { get; set; } + /// ResourceGuard Operation Requests + string[] ResourceGuardOperationRequest { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResource.json.cs new file mode 100644 index 000000000000..eb3f9d894949 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup policy. Workload-specific backup policies are derived from this class. + /// + public partial class ProtectionPolicyResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectionPolicyResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionPolicyResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicy.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResourceList.cs new file mode 100644 index 000000000000..1dc400c8cfe7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectionPolicy resources + public partial class ProtectionPolicyResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ProtectionPolicyResourceList() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + } + /// List of ProtectionPolicy resources + public partial interface IProtectionPolicyResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource[] Value { get; set; } + + } + /// List of ProtectionPolicy resources + internal partial interface IProtectionPolicyResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResourceList.json.cs new file mode 100644 index 000000000000..3aa6e090d4b1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ProtectionPolicyResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectionPolicy resources + public partial class ProtectionPolicyResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ProtectionPolicyResourceList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectionPolicyResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicyResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPoint.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPoint.cs new file mode 100644 index 000000000000..b0d6859f29ef --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPoint.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + /// + public partial class RecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal + { + + /// Backing field for property. + private string _objectType; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Creates an new instance. + public RecoveryPoint() + { + + } + } + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + public partial interface IRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + internal partial interface IRecoveryPointInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPoint.json.cs new file mode 100644 index 000000000000..9577759c00dc --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPoint.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + /// + public partial class RecoveryPoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureFileShareRecoveryPoint": + { + return new AzureFileShareRecoveryPoint(json); + } + case "AzureWorkloadRecoveryPoint": + { + return new AzureWorkloadRecoveryPoint(json); + } + case "AzureWorkloadPointInTimeRecoveryPoint": + { + return new AzureWorkloadPointInTimeRecoveryPoint(json); + } + case "AzureWorkloadSAPHanaPointInTimeRecoveryPoint": + { + return new AzureWorkloadSapHanaPointInTimeRecoveryPoint(json); + } + case "AzureWorkloadSAPHanaRecoveryPoint": + { + return new AzureWorkloadSapHanaRecoveryPoint(json); + } + case "AzureWorkloadSQLRecoveryPoint": + { + return new AzureWorkloadSqlRecoveryPoint(json); + } + case "AzureWorkloadSQLPointInTimeRecoveryPoint": + { + return new AzureWorkloadSqlPointInTimeRecoveryPoint(json); + } + case "GenericRecoveryPoint": + { + return new GenericRecoveryPoint(json); + } + case "IaasVMRecoveryPoint": + { + return new IaasVMRecoveryPoint(json); + } + } + return new RecoveryPoint(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RecoveryPoint(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointDiskConfiguration.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointDiskConfiguration.cs new file mode 100644 index 000000000000..e50851ab3c44 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointDiskConfiguration.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Disk configuration + public partial class RecoveryPointDiskConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] _excludedDiskList; + + /// Information of disks excluded from backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] ExcludedDiskList { get => this._excludedDiskList; set => this._excludedDiskList = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] _includedDiskList; + + /// Information of disks included in backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] IncludedDiskList { get => this._includedDiskList; set => this._includedDiskList = value; } + + /// Backing field for property. + private int? _numberOfDisksAttachedToVM; + + /// Number of disks attached to the VM + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? NumberOfDisksAttachedToVM { get => this._numberOfDisksAttachedToVM; set => this._numberOfDisksAttachedToVM = value; } + + /// Backing field for property. + private int? _numberOfDisksIncludedInBackup; + + /// Number of disks included in backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? NumberOfDisksIncludedInBackup { get => this._numberOfDisksIncludedInBackup; set => this._numberOfDisksIncludedInBackup = value; } + + /// Creates an new instance. + public RecoveryPointDiskConfiguration() + { + + } + } + /// Disk configuration + public partial interface IRecoveryPointDiskConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Information of disks excluded from backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information of disks excluded from backup", + SerializedName = @"excludedDiskList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] ExcludedDiskList { get; set; } + /// Information of disks included in backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information of disks included in backup", + SerializedName = @"includedDiskList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] IncludedDiskList { get; set; } + /// Number of disks attached to the VM + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of disks attached to the VM", + SerializedName = @"numberOfDisksAttachedToVm", + PossibleTypes = new [] { typeof(int) })] + int? NumberOfDisksAttachedToVM { get; set; } + /// Number of disks included in backup + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of disks included in backup", + SerializedName = @"numberOfDisksIncludedInBackup", + PossibleTypes = new [] { typeof(int) })] + int? NumberOfDisksIncludedInBackup { get; set; } + + } + /// Disk configuration + internal partial interface IRecoveryPointDiskConfigurationInternal + + { + /// Information of disks excluded from backup + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] ExcludedDiskList { get; set; } + /// Information of disks included in backup + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation[] IncludedDiskList { get; set; } + /// Number of disks attached to the VM + int? NumberOfDisksAttachedToVM { get; set; } + /// Number of disks included in backup + int? NumberOfDisksIncludedInBackup { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointDiskConfiguration.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointDiskConfiguration.json.cs new file mode 100644 index 000000000000..47f0a218ec83 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointDiskConfiguration.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Disk configuration + public partial class RecoveryPointDiskConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointDiskConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RecoveryPointDiskConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RecoveryPointDiskConfiguration(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_numberOfDisksIncludedInBackup = If( json?.PropertyT("numberOfDisksIncludedInBackup"), out var __jsonNumberOfDisksIncludedInBackup) ? (int?)__jsonNumberOfDisksIncludedInBackup : NumberOfDisksIncludedInBackup;} + {_numberOfDisksAttachedToVM = If( json?.PropertyT("numberOfDisksAttachedToVm"), out var __jsonNumberOfDisksAttachedToVM) ? (int?)__jsonNumberOfDisksAttachedToVM : NumberOfDisksAttachedToVM;} + {_includedDiskList = If( json?.PropertyT("includedDiskList"), out var __jsonIncludedDiskList) ? If( __jsonIncludedDiskList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DiskInformation.FromJson(__u) )) ))() : null : IncludedDiskList;} + {_excludedDiskList = If( json?.PropertyT("excludedDiskList"), out var __jsonExcludedDiskList) ? If( __jsonExcludedDiskList as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDiskInformation) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DiskInformation.FromJson(__p) )) ))() : null : ExcludedDiskList;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._numberOfDisksIncludedInBackup ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._numberOfDisksIncludedInBackup) : null, "numberOfDisksIncludedInBackup" ,container.Add ); + AddIf( null != this._numberOfDisksAttachedToVM ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._numberOfDisksAttachedToVM) : null, "numberOfDisksAttachedToVm" ,container.Add ); + if (null != this._includedDiskList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._includedDiskList ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("includedDiskList",__w); + } + if (null != this._excludedDiskList) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._excludedDiskList ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("excludedDiskList",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointMoveReadinessInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointMoveReadinessInfo.cs new file mode 100644 index 000000000000..b5f8b4d12cdf --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointMoveReadinessInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class RecoveryPointMoveReadinessInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfoInternal + { + + /// Backing field for property. + private string _additionalInfo; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AdditionalInfo { get => this._additionalInfo; set => this._additionalInfo = value; } + + /// Backing field for property. + private bool? _isReadyForMove; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsReadyForMove { get => this._isReadyForMove; set => this._isReadyForMove = value; } + + /// Creates an new instance. + public RecoveryPointMoveReadinessInfo() + { + + } + } + public partial interface IRecoveryPointMoveReadinessInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(string) })] + string AdditionalInfo { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"isReadyForMove", + PossibleTypes = new [] { typeof(bool) })] + bool? IsReadyForMove { get; set; } + + } + internal partial interface IRecoveryPointMoveReadinessInfoInternal + + { + string AdditionalInfo { get; set; } + + bool? IsReadyForMove { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointMoveReadinessInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointMoveReadinessInfo.json.cs new file mode 100644 index 000000000000..e35416638262 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointMoveReadinessInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class RecoveryPointMoveReadinessInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointMoveReadinessInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RecoveryPointMoveReadinessInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RecoveryPointMoveReadinessInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_isReadyForMove = If( json?.PropertyT("isReadyForMove"), out var __jsonIsReadyForMove) ? (bool?)__jsonIsReadyForMove : IsReadyForMove;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? (string)__jsonAdditionalInfo : (string)AdditionalInfo;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._isReadyForMove ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isReadyForMove) : null, "isReadyForMove" ,container.Add ); + AddIf( null != (((object)this._additionalInfo)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._additionalInfo.ToString()) : null, "additionalInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointRehydrationInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointRehydrationInfo.cs new file mode 100644 index 000000000000..66f68b1b3675 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointRehydrationInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// RP Rehydration Info + public partial class RecoveryPointRehydrationInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? _rehydrationPriority; + + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RehydrationPriority { get => this._rehydrationPriority; set => this._rehydrationPriority = value; } + + /// Backing field for property. + private string _rehydrationRetentionDuration; + + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RehydrationRetentionDuration { get => this._rehydrationRetentionDuration; set => this._rehydrationRetentionDuration = value; } + + /// Creates an new instance. + public RecoveryPointRehydrationInfo() + { + + } + } + /// RP Rehydration Info + public partial interface IRecoveryPointRehydrationInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Rehydration Priority + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rehydration Priority", + SerializedName = @"rehydrationPriority", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How long the rehydrated RP should be kept + Should be ISO8601 Duration format e.g. ""P7D""", + SerializedName = @"rehydrationRetentionDuration", + PossibleTypes = new [] { typeof(string) })] + string RehydrationRetentionDuration { get; set; } + + } + /// RP Rehydration Info + internal partial interface IRecoveryPointRehydrationInfoInternal + + { + /// Rehydration Priority + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority? RehydrationPriority { get; set; } + /// + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + string RehydrationRetentionDuration { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointRehydrationInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointRehydrationInfo.json.cs new file mode 100644 index 000000000000..43018451cb1a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointRehydrationInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// RP Rehydration Info + public partial class RecoveryPointRehydrationInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointRehydrationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RecoveryPointRehydrationInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RecoveryPointRehydrationInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_rehydrationRetentionDuration = If( json?.PropertyT("rehydrationRetentionDuration"), out var __jsonRehydrationRetentionDuration) ? (string)__jsonRehydrationRetentionDuration : (string)RehydrationRetentionDuration;} + {_rehydrationPriority = If( json?.PropertyT("rehydrationPriority"), out var __jsonRehydrationPriority) ? (string)__jsonRehydrationPriority : (string)RehydrationPriority;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._rehydrationRetentionDuration)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._rehydrationRetentionDuration.ToString()) : null, "rehydrationRetentionDuration" ,container.Add ); + AddIf( null != (((object)this._rehydrationPriority)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._rehydrationPriority.ToString()) : null, "rehydrationPriority" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResource.cs new file mode 100644 index 000000000000..48b037e82bc8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResource.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + /// + public partial class RecoveryPointResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)Property).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointInternal)Property).ObjectType = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint _property; + + /// RecoveryPointResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint()); set => this._property = value; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public RecoveryPointResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + public partial interface IRecoveryPointResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + internal partial interface IRecoveryPointResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + /// RecoveryPointResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPoint Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResource.json.cs new file mode 100644 index 000000000000..f99abb95a01b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + /// + public partial class RecoveryPointResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RecoveryPointResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RecoveryPointResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPoint.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResourceList.cs new file mode 100644 index 000000000000..8a675fd5b9b7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of RecoveryPoint resources + public partial class RecoveryPointResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public RecoveryPointResourceList() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + } + /// List of RecoveryPoint resources + public partial interface IRecoveryPointResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResource[] Value { get; set; } + + } + /// List of RecoveryPoint resources + internal partial interface IRecoveryPointResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResourceList.json.cs new file mode 100644 index 000000000000..20073e78a969 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of RecoveryPoint resources + public partial class RecoveryPointResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RecoveryPointResourceList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RecoveryPointResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformation.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformation.cs new file mode 100644 index 000000000000..c3dae5c3835e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformation.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point tier information. + public partial class RecoveryPointTierInformation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformation, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfo _extendedInfo; + + /// Recovery point tier status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointTierInformationExtendedInfo()); set => this._extendedInfo = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus? _status; + + /// Recovery point tier status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus? Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? _type; + + /// Recovery point tier type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public RecoveryPointTierInformation() + { + + } + } + /// Recovery point tier information. + public partial interface IRecoveryPointTierInformation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Recovery point tier status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point tier status.", + SerializedName = @"extendedInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfo ExtendedInfo { get; set; } + /// Recovery point tier status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point tier status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus? Status { get; set; } + /// Recovery point tier type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point tier type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? Type { get; set; } + + } + /// Recovery point tier information. + internal partial interface IRecoveryPointTierInformationInternal + + { + /// Recovery point tier status. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfo ExtendedInfo { get; set; } + /// Recovery point tier status. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus? Status { get; set; } + /// Recovery point tier type. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformation.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformation.json.cs new file mode 100644 index 000000000000..0b74cf98dc79 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformation.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point tier information. + public partial class RecoveryPointTierInformation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RecoveryPointTierInformation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RecoveryPointTierInformation(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointTierInformationExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.cs new file mode 100644 index 000000000000..fd3236e0f929 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point tier status. + public partial class RecoveryPointTierInformationExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfoInternal + { + + /// + /// Creates an new instance. + /// + public RecoveryPointTierInformationExtendedInfo() + { + + } + } + /// Recovery point tier status. + public partial interface IRecoveryPointTierInformationExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Recovery point tier status. + internal partial interface IRecoveryPointTierInformationExtendedInfoInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.dictionary.cs new file mode 100644 index 000000000000..117fec783445 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class RecoveryPointTierInformationExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointTierInformationExtendedInfo source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.json.cs new file mode 100644 index 000000000000..84948ddc1538 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point tier status. + public partial class RecoveryPointTierInformationExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RecoveryPointTierInformationExtendedInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal RecoveryPointTierInformationExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationV2.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationV2.cs new file mode 100644 index 000000000000..46b530108e21 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationV2.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// RecoveryPoint Tier Information V2 + public partial class RecoveryPointTierInformationV2 : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2Internal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformation __recoveryPointTierInformation = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointTierInformation(); + + /// Recovery point tier status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationInternal)__recoveryPointTierInformation).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationInternal)__recoveryPointTierInformation).ExtendedInfo = value ?? null /* model class */; } + + /// Recovery point tier status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationInternal)__recoveryPointTierInformation).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationInternal)__recoveryPointTierInformation).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus)""); } + + /// Recovery point tier type. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationInternal)__recoveryPointTierInformation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationInternal)__recoveryPointTierInformation).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType)""); } + + /// Creates an new instance. + public RecoveryPointTierInformationV2() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__recoveryPointTierInformation), __recoveryPointTierInformation); + await eventListener.AssertObjectIsValid(nameof(__recoveryPointTierInformation), __recoveryPointTierInformation); + } + } + /// RecoveryPoint Tier Information V2 + public partial interface IRecoveryPointTierInformationV2 : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformation + { + + } + /// RecoveryPoint Tier Information V2 + internal partial interface IRecoveryPointTierInformationV2Internal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationV2.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationV2.json.cs new file mode 100644 index 000000000000..e37be3b0b839 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RecoveryPointTierInformationV2.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// RecoveryPoint Tier Information V2 + public partial class RecoveryPointTierInformationV2 + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRecoveryPointTierInformationV2 FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RecoveryPointTierInformationV2(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RecoveryPointTierInformationV2(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __recoveryPointTierInformation = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointTierInformation(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __recoveryPointTierInformation?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Resource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Resource.cs new file mode 100644 index 000000000000..4648d90ebc06 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Resource.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// ARM Resource. + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + + /// Backing field for property. + private string _eTag; + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Backing field for property. + private string _id; + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Backing field for property. + private string _location; + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceTags()); set => this._tag = value; } + + /// Backing field for property. + private string _type; + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Resource() + { + + } + } + /// ARM Resource. + public partial interface IResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional ETag.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Id represents the complete path to the resource.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource name associated with the resource.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get; set; } + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// ARM Resource. + internal partial interface IResourceInternal + + { + /// Optional ETag. + string ETag { get; set; } + /// Resource Id represents the complete path to the resource. + string Id { get; set; } + /// Resource location. + string Location { get; set; } + /// Resource name associated with the resource. + string Name { get; set; } + /// Resource tags. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get; set; } + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Resource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Resource.json.cs new file mode 100644 index 000000000000..cd978dac8ca7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Resource.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// ARM Resource. + public partial class Resource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceTags.FromJson(__jsonTags) : Tag;} + {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)ETag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AddIf( null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._eTag.ToString()) : null, "eTag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardOperationDetail.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardOperationDetail.cs new file mode 100644 index 000000000000..243b878b8195 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardOperationDetail.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class ResourceGuardOperationDetail : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetailInternal + { + + /// Backing field for property. + private string _defaultResourceRequest; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DefaultResourceRequest { get => this._defaultResourceRequest; set => this._defaultResourceRequest = value; } + + /// Backing field for property. + private string _vaultCriticalOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VaultCriticalOperation { get => this._vaultCriticalOperation; set => this._vaultCriticalOperation = value; } + + /// Creates an new instance. + public ResourceGuardOperationDetail() + { + + } + } + public partial interface IResourceGuardOperationDetail : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"defaultResourceRequest", + PossibleTypes = new [] { typeof(string) })] + string DefaultResourceRequest { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"vaultCriticalOperation", + PossibleTypes = new [] { typeof(string) })] + string VaultCriticalOperation { get; set; } + + } + internal partial interface IResourceGuardOperationDetailInternal + + { + string DefaultResourceRequest { get; set; } + + string VaultCriticalOperation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardOperationDetail.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardOperationDetail.json.cs new file mode 100644 index 000000000000..46041c09e6e0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardOperationDetail.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class ResourceGuardOperationDetail + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ResourceGuardOperationDetail(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceGuardOperationDetail(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_vaultCriticalOperation = If( json?.PropertyT("vaultCriticalOperation"), out var __jsonVaultCriticalOperation) ? (string)__jsonVaultCriticalOperation : (string)VaultCriticalOperation;} + {_defaultResourceRequest = If( json?.PropertyT("defaultResourceRequest"), out var __jsonDefaultResourceRequest) ? (string)__jsonDefaultResourceRequest : (string)DefaultResourceRequest;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._vaultCriticalOperation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._vaultCriticalOperation.ToString()) : null, "vaultCriticalOperation" ,container.Add ); + AddIf( null != (((object)this._defaultResourceRequest)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._defaultResourceRequest.ToString()) : null, "defaultResourceRequest" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBase.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBase.cs new file mode 100644 index 000000000000..55e6837b9588 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBase.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class ResourceGuardProxyBase : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBase, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseInternal + { + + /// Backing field for property. + private string _description; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _lastUpdatedTime; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string LastUpdatedTime { get => this._lastUpdatedTime; set => this._lastUpdatedTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail[] _resourceGuardOperationDetail; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail[] ResourceGuardOperationDetail { get => this._resourceGuardOperationDetail; set => this._resourceGuardOperationDetail = value; } + + /// Backing field for property. + private string _resourceGuardResourceId; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceGuardResourceId { get => this._resourceGuardResourceId; set => this._resourceGuardResourceId = value; } + + /// Creates an new instance. + public ResourceGuardProxyBase() + { + + } + } + public partial interface IResourceGuardProxyBase : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastUpdatedTime", + PossibleTypes = new [] { typeof(string) })] + string LastUpdatedTime { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"resourceGuardOperationDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail[] ResourceGuardOperationDetail { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"resourceGuardResourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceGuardResourceId { get; set; } + + } + internal partial interface IResourceGuardProxyBaseInternal + + { + string Description { get; set; } + + string LastUpdatedTime { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail[] ResourceGuardOperationDetail { get; set; } + + string ResourceGuardResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBase.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBase.json.cs new file mode 100644 index 000000000000..f48879a3f64a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBase.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class ResourceGuardProxyBase + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBase. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBase. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ResourceGuardProxyBase(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceGuardProxyBase(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceGuardResourceId = If( json?.PropertyT("resourceGuardResourceId"), out var __jsonResourceGuardResourceId) ? (string)__jsonResourceGuardResourceId : (string)ResourceGuardResourceId;} + {_resourceGuardOperationDetail = If( json?.PropertyT("resourceGuardOperationDetails"), out var __jsonResourceGuardOperationDetails) ? If( __jsonResourceGuardOperationDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceGuardOperationDetail.FromJson(__u) )) ))() : null : ResourceGuardOperationDetail;} + {_lastUpdatedTime = If( json?.PropertyT("lastUpdatedTime"), out var __jsonLastUpdatedTime) ? (string)__jsonLastUpdatedTime : (string)LastUpdatedTime;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceGuardResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceGuardResourceId.ToString()) : null, "resourceGuardResourceId" ,container.Add ); + if (null != this._resourceGuardOperationDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._resourceGuardOperationDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("resourceGuardOperationDetails",__w); + } + AddIf( null != (((object)this._lastUpdatedTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._lastUpdatedTime.ToString()) : null, "lastUpdatedTime" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResource.cs new file mode 100644 index 000000000000..d18d9ee889ae --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResource.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class ResourceGuardProxyBaseResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseInternal)Property).Description = value ?? null; } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string LastUpdatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseInternal)Property).LastUpdatedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseInternal)Property).LastUpdatedTime = value ?? null; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBase Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceGuardProxyBase()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBase _property; + + /// ResourceGuardProxyBaseResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBase Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceGuardProxyBase()); set => this._property = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail[] ResourceGuardOperationDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseInternal)Property).ResourceGuardOperationDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseInternal)Property).ResourceGuardOperationDetail = value ?? null /* arrayOf */; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ResourceGuardResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseInternal)Property).ResourceGuardResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseInternal)Property).ResourceGuardResourceId = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ResourceGuardProxyBaseResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + public partial interface IResourceGuardProxyBaseResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"lastUpdatedTime", + PossibleTypes = new [] { typeof(string) })] + string LastUpdatedTime { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"resourceGuardOperationDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail[] ResourceGuardOperationDetail { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"resourceGuardResourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceGuardResourceId { get; set; } + + } + internal partial interface IResourceGuardProxyBaseResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + string Description { get; set; } + + string LastUpdatedTime { get; set; } + /// ResourceGuardProxyBaseResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBase Property { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardOperationDetail[] ResourceGuardOperationDetail { get; set; } + + string ResourceGuardResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResource.json.cs new file mode 100644 index 000000000000..be6825b8c1df --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class ResourceGuardProxyBaseResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ResourceGuardProxyBaseResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceGuardProxyBaseResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceGuardProxyBase.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResourceList.cs new file mode 100644 index 000000000000..b9dc72116396 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ResourceGuardProxyBase resources + public partial class ResourceGuardProxyBaseResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ResourceGuardProxyBaseResourceList() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + } + /// List of ResourceGuardProxyBase resources + public partial interface IResourceGuardProxyBaseResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResource[] Value { get; set; } + + } + /// List of ResourceGuardProxyBase resources + internal partial interface IResourceGuardProxyBaseResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResourceList.json.cs new file mode 100644 index 000000000000..2ada4749ea09 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceGuardProxyBaseResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ResourceGuardProxyBase resources + public partial class ResourceGuardProxyBaseResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ResourceGuardProxyBaseResourceList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceGuardProxyBaseResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceGuardProxyBaseResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceGuardProxyBaseResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceHealthDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceHealthDetails.cs new file mode 100644 index 000000000000..0eb3e51324c2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceHealthDetails.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health Details for backup items. + public partial class ResourceHealthDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal + { + + /// Backing field for property. + private int? _code; + + /// Health Code + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? Code { get => this._code; } + + /// Backing field for property. + private string _message; + + /// Health Message + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + int? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal.Recommendation { get => this._recommendation; set { {_recommendation = value;} } } + + /// Internal Acessors for Title + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetailsInternal.Title { get => this._title; set { {_title = value;} } } + + /// Backing field for property. + private string[] _recommendation; + + /// Health Recommended Actions + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; } + + /// Backing field for property. + private string _title; + + /// Health Title + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Title { get => this._title; } + + /// Creates an new instance. + public ResourceHealthDetails() + { + + } + } + /// Health Details for backup items. + public partial interface IResourceHealthDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Health Code + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Health Code", + SerializedName = @"code", + PossibleTypes = new [] { typeof(int) })] + int? Code { get; } + /// Health Message + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Health Message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Health Recommended Actions + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Health Recommended Actions", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; } + /// Health Title + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Health Title", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; } + + } + /// Health Details for backup items. + internal partial interface IResourceHealthDetailsInternal + + { + /// Health Code + int? Code { get; set; } + /// Health Message + string Message { get; set; } + /// Health Recommended Actions + string[] Recommendation { get; set; } + /// Health Title + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceHealthDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceHealthDetails.json.cs new file mode 100644 index 000000000000..cdb47d3f8094 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceHealthDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health Details for backup items. + public partial class ResourceHealthDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceHealthDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ResourceHealthDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceHealthDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (int?)__jsonCode : Code;} + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_recommendation = If( json?.PropertyT("recommendations"), out var __jsonRecommendations) ? If( __jsonRecommendations as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Recommendation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._code ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._code) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceList.cs new file mode 100644 index 000000000000..03ebb0f27dde --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base for all lists of resources. + public partial class ResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Creates an new instance. + public ResourceList() + { + + } + } + /// Base for all lists of resources. + public partial interface IResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The uri to fetch the next page of resources. Call ListNext() fetches next page of resources.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + + } + /// Base for all lists of resources. + internal partial interface IResourceListInternal + + { + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + string NextLink { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceList.json.cs new file mode 100644 index 000000000000..e6e7dca7a250 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base for all lists of resources. + public partial class ResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ResourceList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.cs new file mode 100644 index 000000000000..34dd11afdab1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Resource tags. + public partial class ResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTagsInternal + { + + /// Creates an new instance. + public ResourceTags() + { + + } + } + /// Resource tags. + public partial interface IResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.dictionary.cs new file mode 100644 index 000000000000..f00148bc3617 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class ResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.json.cs new file mode 100644 index 000000000000..12986d60d298 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ResourceTags.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Resource tags. + public partial class ResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ResourceTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ResourceTags(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreFileSpecs.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreFileSpecs.cs new file mode 100644 index 000000000000..97978fcbb08c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreFileSpecs.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Restore file specs like file path, type and target folder path info. + public partial class RestoreFileSpecs : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecs, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecsInternal + { + + /// Backing field for property. + private string _fileSpecType; + + /// Indicates what the Path variable stands for + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FileSpecType { get => this._fileSpecType; set => this._fileSpecType = value; } + + /// Backing field for property. + private string _path; + + /// Source File/Folder path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Path { get => this._path; set => this._path = value; } + + /// Backing field for property. + private string _targetFolderPath; + + /// Destination folder path in target FileShare + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetFolderPath { get => this._targetFolderPath; set => this._targetFolderPath = value; } + + /// Creates an new instance. + public RestoreFileSpecs() + { + + } + } + /// Restore file specs like file path, type and target folder path info. + public partial interface IRestoreFileSpecs : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Indicates what the Path variable stands for + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates what the Path variable stands for", + SerializedName = @"fileSpecType", + PossibleTypes = new [] { typeof(string) })] + string FileSpecType { get; set; } + /// Source File/Folder path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source File/Folder path", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + /// Destination folder path in target FileShare + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Destination folder path in target FileShare", + SerializedName = @"targetFolderPath", + PossibleTypes = new [] { typeof(string) })] + string TargetFolderPath { get; set; } + + } + /// Restore file specs like file path, type and target folder path info. + internal partial interface IRestoreFileSpecsInternal + + { + /// Indicates what the Path variable stands for + string FileSpecType { get; set; } + /// Source File/Folder path + string Path { get; set; } + /// Destination folder path in target FileShare + string TargetFolderPath { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreFileSpecs.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreFileSpecs.json.cs new file mode 100644 index 000000000000..6a503a930efa --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreFileSpecs.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Restore file specs like file path, type and target folder path info. + public partial class RestoreFileSpecs + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecs. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecs. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreFileSpecs FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RestoreFileSpecs(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RestoreFileSpecs(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + {_fileSpecType = If( json?.PropertyT("fileSpecType"), out var __jsonFileSpecType) ? (string)__jsonFileSpecType : (string)FileSpecType;} + {_targetFolderPath = If( json?.PropertyT("targetFolderPath"), out var __jsonTargetFolderPath) ? (string)__jsonTargetFolderPath : (string)TargetFolderPath;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); + AddIf( null != (((object)this._fileSpecType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._fileSpecType.ToString()) : null, "fileSpecType" ,container.Add ); + AddIf( null != (((object)this._targetFolderPath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetFolderPath.ToString()) : null, "targetFolderPath" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequest.cs new file mode 100644 index 000000000000..9b1d994de1c9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for restore request. Workload-specific restore requests are derived from this class. + /// + public partial class RestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal + { + + /// Backing field for property. + private string _objectType; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Creates an new instance. + public RestoreRequest() + { + + } + } + /// Base class for restore request. Workload-specific restore requests are derived from this class. + public partial interface IRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Base class for restore request. Workload-specific restore requests are derived from this class. + internal partial interface IRestoreRequestInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequest.json.cs new file mode 100644 index 000000000000..ce16fb584318 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for restore request. Workload-specific restore requests are derived from this class. + /// + public partial class RestoreRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "AzureFileShareRestoreRequest": + { + return new AzureFileShareRestoreRequest(json); + } + case "AzureWorkloadRestoreRequest": + { + return new AzureWorkloadRestoreRequest(json); + } + case "AzureWorkloadPointInTimeRestoreRequest": + { + return new AzureWorkloadPointInTimeRestoreRequest(json); + } + case "AzureWorkloadSAPHanaPointInTimeRestoreRequest": + { + return new AzureWorkloadSapHanaPointInTimeRestoreRequest(json); + } + case "AzureWorkloadSAPHanaRestoreRequest": + { + return new AzureWorkloadSapHanaRestoreRequest(json); + } + case "AzureWorkloadSQLRestoreRequest": + { + return new AzureWorkloadSqlRestoreRequest(json); + } + case "AzureWorkloadSQLPointInTimeRestoreRequest": + { + return new AzureWorkloadSqlPointInTimeRestoreRequest(json); + } + case "IaasVMRestoreRequest": + { + return new IaasVMRestoreRequest(json); + } + case "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest": + { + return new AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest(json); + } + case "AzureWorkloadSAPHanaRestoreWithRehydrateRequest": + { + return new AzureWorkloadSapHanaRestoreWithRehydrateRequest(json); + } + case "AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest": + { + return new AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest(json); + } + case "AzureWorkloadSQLRestoreWithRehydrateRequest": + { + return new AzureWorkloadSqlRestoreWithRehydrateRequest(json); + } + case "IaasVMRestoreWithRehydrationRequest": + { + return new IaasVMRestoreWithRehydrationRequest(json); + } + } + return new RestoreRequest(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RestoreRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequestResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequestResource.cs new file mode 100644 index 000000000000..0d72e3503778 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequestResource.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for restore request. Workload-specific restore requests are derived from this class. + /// + public partial class RestoreRequestResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest()); set { {_property = value;} } } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)Property).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)Property).ObjectType = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest _property; + + /// RestoreRequestResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest()); set => this._property = value; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public RestoreRequestResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Base class for restore request. Workload-specific restore requests are derived from this class. + public partial interface IRestoreRequestResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Base class for restore request. Workload-specific restore requests are derived from this class. + internal partial interface IRestoreRequestResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + /// RestoreRequestResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequestResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequestResource.json.cs new file mode 100644 index 000000000000..87c4d4345a0c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RestoreRequestResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for restore request. Workload-specific restore requests are derived from this class. + /// + public partial class RestoreRequestResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RestoreRequestResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RestoreRequestResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionDuration.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionDuration.cs new file mode 100644 index 000000000000..4ec9e8c82521 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionDuration.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Retention duration. + public partial class RetentionDuration : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal + { + + /// Backing field for property. + private int? _count; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? _durationType; + + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? DurationType { get => this._durationType; set => this._durationType = value; } + + /// Creates an new instance. + public RetentionDuration() + { + + } + } + /// Retention duration. + public partial interface IRetentionDuration : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? Count { get; set; } + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type of retention policy.", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? DurationType { get; set; } + + } + /// Retention duration. + internal partial interface IRetentionDurationInternal + + { + /// + /// 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. + /// + int? Count { get; set; } + /// Retention duration type of retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? DurationType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionDuration.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionDuration.json.cs new file mode 100644 index 000000000000..48ff2ccecce3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionDuration.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Retention duration. + public partial class RetentionDuration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RetentionDuration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RetentionDuration(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (int?)__jsonCount : Count;} + {_durationType = If( json?.PropertyT("durationType"), out var __jsonDurationType) ? (string)__jsonDurationType : (string)DurationType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._durationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._durationType.ToString()) : null, "durationType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionPolicy.cs new file mode 100644 index 000000000000..b9ac8d7ba533 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionPolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for retention policy. + public partial class RetentionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal + { + + /// Backing field for property. + private string _type; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public RetentionPolicy() + { + + } + } + /// Base class for retention policy. + public partial interface IRetentionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"retentionPolicyType", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// Base class for retention policy. + internal partial interface IRetentionPolicyInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionPolicy.json.cs new file mode 100644 index 000000000000..2a747ca6837e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/RetentionPolicy.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for retention policy. + public partial class RetentionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("retentionPolicyType") ) + { + case "LongTermRetentionPolicy": + { + return new LongTermRetentionPolicy(json); + } + case "SimpleRetentionPolicy": + { + return new SimpleRetentionPolicy(json); + } + } + return new RetentionPolicy(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RetentionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("retentionPolicyType"), out var __jsonRetentionPolicyType) ? (string)__jsonRetentionPolicyType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "retentionPolicyType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SchedulePolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SchedulePolicy.cs new file mode 100644 index 000000000000..54d984b15de0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SchedulePolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup schedule. + public partial class SchedulePolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal + { + + /// Backing field for property. + private string _type; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public SchedulePolicy() + { + + } + } + /// Base class for backup schedule. + public partial interface ISchedulePolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"schedulePolicyType", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// Base class for backup schedule. + internal partial interface ISchedulePolicyInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SchedulePolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SchedulePolicy.json.cs new file mode 100644 index 000000000000..c67b3d0511cd --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SchedulePolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup schedule. + public partial class SchedulePolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("schedulePolicyType") ) + { + case "LogSchedulePolicy": + { + return new LogSchedulePolicy(json); + } + case "LongTermSchedulePolicy": + { + return new LongTermSchedulePolicy(json); + } + case "SimpleSchedulePolicy": + { + return new SimpleSchedulePolicy(json); + } + case "SimpleSchedulePolicyV2": + { + return new SimpleSchedulePolicyV2(json); + } + } + return new SchedulePolicy(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal SchedulePolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("schedulePolicyType"), out var __jsonSchedulePolicyType) ? (string)__jsonSchedulePolicyType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "schedulePolicyType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SecurityPinBase.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SecurityPinBase.cs new file mode 100644 index 000000000000..88f9d3704dc8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SecurityPinBase.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for get security pin request body + public partial class SecurityPinBase : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISecurityPinBase, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISecurityPinBaseInternal + { + + /// Backing field for property. + private string[] _resourceGuardOperationRequest; + + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] ResourceGuardOperationRequest { get => this._resourceGuardOperationRequest; set => this._resourceGuardOperationRequest = value; } + + /// Creates an new instance. + public SecurityPinBase() + { + + } + } + /// Base class for get security pin request body + public partial interface ISecurityPinBase : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// ResourceGuard Operation Requests + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ResourceGuard Operation Requests", + SerializedName = @"resourceGuardOperationRequests", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceGuardOperationRequest { get; set; } + + } + /// Base class for get security pin request body + internal partial interface ISecurityPinBaseInternal + + { + /// ResourceGuard Operation Requests + string[] ResourceGuardOperationRequest { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SecurityPinBase.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SecurityPinBase.json.cs new file mode 100644 index 000000000000..78fa64d5b8c5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SecurityPinBase.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for get security pin request body + public partial class SecurityPinBase + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISecurityPinBase. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISecurityPinBase. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISecurityPinBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new SecurityPinBase(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal SecurityPinBase(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceGuardOperationRequest = If( json?.PropertyT("resourceGuardOperationRequests"), out var __jsonResourceGuardOperationRequests) ? If( __jsonResourceGuardOperationRequests as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ResourceGuardOperationRequest;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._resourceGuardOperationRequest) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._resourceGuardOperationRequest ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("resourceGuardOperationRequests",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Settings.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Settings.cs new file mode 100644 index 000000000000..48ba82423138 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Settings.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Common settings field for backup management + public partial class Settings : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettings, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettingsInternal + { + + /// Backing field for property. + private bool? _isCompression; + + /// + /// Workload compression flag. This has been added so that 'isSqlCompression' + /// will be deprecated once clients upgrade to consider this flag. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsCompression { get => this._isCompression; set => this._isCompression = value; } + + /// Backing field for property. + private bool? _issqlcompression; + + /// SQL compression flag + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? Issqlcompression { get => this._issqlcompression; set => this._issqlcompression = value; } + + /// Backing field for property. + private string _timeZone; + + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TimeZone { get => this._timeZone; set => this._timeZone = value; } + + /// Creates an new instance. + public Settings() + { + + } + } + /// Common settings field for backup management + public partial interface ISettings : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// Workload compression flag. This has been added so that 'isSqlCompression' + /// will be deprecated once clients upgrade to consider this flag. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workload compression flag. This has been added so that 'isSqlCompression' + will be deprecated once clients upgrade to consider this flag.", + SerializedName = @"isCompression", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCompression { get; set; } + /// SQL compression flag + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SQL compression flag", + SerializedName = @"issqlcompression", + PossibleTypes = new [] { typeof(bool) })] + bool? Issqlcompression { get; set; } + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"TimeZone optional input as string. For example: TimeZone = ""Pacific Standard Time"".", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string TimeZone { get; set; } + + } + /// Common settings field for backup management + internal partial interface ISettingsInternal + + { + /// + /// Workload compression flag. This has been added so that 'isSqlCompression' + /// will be deprecated once clients upgrade to consider this flag. + /// + bool? IsCompression { get; set; } + /// SQL compression flag + bool? Issqlcompression { get; set; } + /// + /// TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + /// + string TimeZone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Settings.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Settings.json.cs new file mode 100644 index 000000000000..03c66ce56f74 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/Settings.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Common settings field for backup management + public partial class Settings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new Settings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal Settings(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)TimeZone;} + {_issqlcompression = If( json?.PropertyT("issqlcompression"), out var __jsonIssqlcompression) ? (bool?)__jsonIssqlcompression : Issqlcompression;} + {_isCompression = If( json?.PropertyT("isCompression"), out var __jsonIsCompression) ? (bool?)__jsonIsCompression : IsCompression;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._timeZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._timeZone.ToString()) : null, "timeZone" ,container.Add ); + AddIf( null != this._issqlcompression ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._issqlcompression) : null, "issqlcompression" ,container.Add ); + AddIf( null != this._isCompression ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isCompression) : null, "isCompression" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleRetentionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleRetentionPolicy.cs new file mode 100644 index 000000000000..8792fb48fb54 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleRetentionPolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Simple policy retention. + public partial class SimpleRetentionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleRetentionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleRetentionPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy __retentionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy(); + + /// Internal Acessors for RetentionDuration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleRetentionPolicyInternal.RetentionDuration { get => (this._retentionDuration = this._retentionDuration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration()); set { {_retentionDuration = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration _retentionDuration; + + /// Retention duration of the protection policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration RetentionDuration { get => (this._retentionDuration = this._retentionDuration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration()); set => this._retentionDuration = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? RetentionDurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).Count = value ?? default(int); } + + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).DurationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).DurationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType)""); } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)__retentionPolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)__retentionPolicy).Type = value ; } + + /// Creates an new instance. + public SimpleRetentionPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__retentionPolicy), __retentionPolicy); + await eventListener.AssertObjectIsValid(nameof(__retentionPolicy), __retentionPolicy); + } + } + /// Simple policy retention. + public partial interface ISimpleRetentionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy + { + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? RetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type of retention policy.", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get; set; } + + } + /// Simple policy retention. + internal partial interface ISimpleRetentionPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal + { + /// Retention duration of the protection policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration RetentionDuration { get; set; } + /// + /// 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. + /// + int? RetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleRetentionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleRetentionPolicy.json.cs new file mode 100644 index 000000000000..86358aaf15ec --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleRetentionPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Simple policy retention. + public partial class SimpleRetentionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleRetentionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleRetentionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleRetentionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new SimpleRetentionPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal SimpleRetentionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __retentionPolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy(json); + {_retentionDuration = If( json?.PropertyT("retentionDuration"), out var __jsonRetentionDuration) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration.FromJson(__jsonRetentionDuration) : RetentionDuration;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __retentionPolicy?.ToJson(container, serializationMode); + AddIf( null != this._retentionDuration ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionDuration.ToJson(null,serializationMode) : null, "retentionDuration" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicy.cs new file mode 100644 index 000000000000..667c4522a828 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicy.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Simple policy schedule. + public partial class SimpleSchedulePolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy __schedulePolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule _hourlySchedule; + + /// Hourly Schedule of this Policy + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule HourlySchedule { get => (this._hourlySchedule = this._hourlySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.HourlySchedule()); set => this._hourlySchedule = value; } + + /// + /// Interval at which backup needs to be triggered. For hourly the value + /// can be 4/6/8/12 + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? HourlyScheduleInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).Interval; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).Interval = value ?? default(int); } + + /// To specify duration of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? HourlyScheduleWindowDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).ScheduleWindowDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).ScheduleWindowDuration = value ?? default(int); } + + /// To specify start time of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? HourlyScheduleWindowStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).ScheduleWindowStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).ScheduleWindowStartTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for HourlySchedule + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicyInternal.HourlySchedule { get => (this._hourlySchedule = this._hourlySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.HourlySchedule()); set { {_hourlySchedule = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] _scheduleRunDay; + + /// List of days of week this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] ScheduleRunDay { get => this._scheduleRunDay; set => this._scheduleRunDay = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType? _scheduleRunFrequency; + + /// Frequency of the schedule operation of this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType? ScheduleRunFrequency { get => this._scheduleRunFrequency; set => this._scheduleRunFrequency = value; } + + /// Backing field for property. + private global::System.DateTime[] _scheduleRunTime; + + /// List of times of day this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime[] ScheduleRunTime { get => this._scheduleRunTime; set => this._scheduleRunTime = value; } + + /// Backing field for property. + private int? _scheduleWeeklyFrequency; + + /// At every number weeks this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? ScheduleWeeklyFrequency { get => this._scheduleWeeklyFrequency; set => this._scheduleWeeklyFrequency = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)__schedulePolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)__schedulePolicy).Type = value ; } + + /// Creates an new instance. + public SimpleSchedulePolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__schedulePolicy), __schedulePolicy); + await eventListener.AssertObjectIsValid(nameof(__schedulePolicy), __schedulePolicy); + } + } + /// Simple policy schedule. + public partial interface ISimpleSchedulePolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy + { + /// + /// Interval at which backup needs to be triggered. For hourly the value + /// can be 4/6/8/12 + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Interval at which backup needs to be triggered. For hourly the value + can be 4/6/8/12", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? HourlyScheduleInterval { get; set; } + /// To specify duration of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To specify duration of the backup window", + SerializedName = @"scheduleWindowDuration", + PossibleTypes = new [] { typeof(int) })] + int? HourlyScheduleWindowDuration { get; set; } + /// To specify start time of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To specify start time of the backup window", + SerializedName = @"scheduleWindowStartTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? HourlyScheduleWindowStartTime { get; set; } + /// List of days of week this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of week this schedule has to be run.", + SerializedName = @"scheduleRunDays", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] ScheduleRunDay { get; set; } + /// Frequency of the schedule operation of this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Frequency of the schedule operation of this policy.", + SerializedName = @"scheduleRunFrequency", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType? ScheduleRunFrequency { get; set; } + /// List of times of day this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of times of day this schedule has to be run.", + SerializedName = @"scheduleRunTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] ScheduleRunTime { get; set; } + /// At every number weeks this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"At every number weeks this schedule has to be run.", + SerializedName = @"scheduleWeeklyFrequency", + PossibleTypes = new [] { typeof(int) })] + int? ScheduleWeeklyFrequency { get; set; } + + } + /// Simple policy schedule. + internal partial interface ISimpleSchedulePolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal + { + /// Hourly Schedule of this Policy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule HourlySchedule { get; set; } + /// + /// Interval at which backup needs to be triggered. For hourly the value + /// can be 4/6/8/12 + /// + int? HourlyScheduleInterval { get; set; } + /// To specify duration of the backup window + int? HourlyScheduleWindowDuration { get; set; } + /// To specify start time of the backup window + global::System.DateTime? HourlyScheduleWindowStartTime { get; set; } + /// List of days of week this schedule has to be run. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] ScheduleRunDay { get; set; } + /// Frequency of the schedule operation of this policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType? ScheduleRunFrequency { get; set; } + /// List of times of day this schedule has to be run. + global::System.DateTime[] ScheduleRunTime { get; set; } + /// At every number weeks this schedule has to be run. + int? ScheduleWeeklyFrequency { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicy.json.cs new file mode 100644 index 000000000000..57e252b98268 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Simple policy schedule. + public partial class SimpleSchedulePolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new SimpleSchedulePolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal SimpleSchedulePolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __schedulePolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy(json); + {_hourlySchedule = If( json?.PropertyT("hourlySchedule"), out var __jsonHourlySchedule) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.HourlySchedule.FromJson(__jsonHourlySchedule) : HourlySchedule;} + {_scheduleRunFrequency = If( json?.PropertyT("scheduleRunFrequency"), out var __jsonScheduleRunFrequency) ? (string)__jsonScheduleRunFrequency : (string)ScheduleRunFrequency;} + {_scheduleRunDay = If( json?.PropertyT("scheduleRunDays"), out var __jsonScheduleRunDays) ? If( __jsonScheduleRunDays as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek)""))) ))() : null : ScheduleRunDay;} + {_scheduleRunTime = If( json?.PropertyT("scheduleRunTimes"), out var __jsonScheduleRunTimes) ? If( __jsonScheduleRunTimes as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(global::System.DateTime) (__p is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __o ? global::System.DateTime.TryParse((string)__o, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __oValue) ? __oValue : default(global::System.DateTime) : default(global::System.DateTime))) ))() : null : ScheduleRunTime;} + {_scheduleWeeklyFrequency = If( json?.PropertyT("scheduleWeeklyFrequency"), out var __jsonScheduleWeeklyFrequency) ? (int?)__jsonScheduleWeeklyFrequency : ScheduleWeeklyFrequency;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __schedulePolicy?.ToJson(container, serializationMode); + AddIf( null != this._hourlySchedule ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._hourlySchedule.ToJson(null,serializationMode) : null, "hourlySchedule" ,container.Add ); + AddIf( null != (((object)this._scheduleRunFrequency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._scheduleRunFrequency.ToString()) : null, "scheduleRunFrequency" ,container.Add ); + if (null != this._scheduleRunDay) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._scheduleRunDay ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("scheduleRunDays",__w); + } + if (null != this._scheduleRunTime) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._scheduleRunTime ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__s.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) ,__r.Add); + } + container.Add("scheduleRunTimes",__r); + } + AddIf( null != this._scheduleWeeklyFrequency ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._scheduleWeeklyFrequency) : null, "scheduleWeeklyFrequency" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicyV2.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicyV2.cs new file mode 100644 index 000000000000..46567cdbe6e2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicyV2.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The V2 policy schedule for IaaS that supports hourly backups. + public partial class SimpleSchedulePolicyV2 : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicyV2, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicyV2Internal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy __schedulePolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailySchedule _dailySchedule; + + /// Daily schedule of this policy + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailySchedule DailySchedule { get => (this._dailySchedule = this._dailySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailySchedule()); set => this._dailySchedule = value; } + + /// List of times of day this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime[] DailyScheduleRunTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyScheduleInternal)DailySchedule).ScheduleRunTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyScheduleInternal)DailySchedule).ScheduleRunTime = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule _hourlySchedule; + + /// hourly schedule of this policy + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule HourlySchedule { get => (this._hourlySchedule = this._hourlySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.HourlySchedule()); set => this._hourlySchedule = value; } + + /// + /// Interval at which backup needs to be triggered. For hourly the value + /// can be 4/6/8/12 + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? HourlyScheduleInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).Interval; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).Interval = value ?? default(int); } + + /// To specify duration of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? HourlyScheduleWindowDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).ScheduleWindowDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).ScheduleWindowDuration = value ?? default(int); } + + /// To specify start time of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime? HourlyScheduleWindowStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).ScheduleWindowStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlyScheduleInternal)HourlySchedule).ScheduleWindowStartTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for DailySchedule + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailySchedule Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicyV2Internal.DailySchedule { get => (this._dailySchedule = this._dailySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailySchedule()); set { {_dailySchedule = value;} } } + + /// Internal Acessors for HourlySchedule + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicyV2Internal.HourlySchedule { get => (this._hourlySchedule = this._hourlySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.HourlySchedule()); set { {_hourlySchedule = value;} } } + + /// Internal Acessors for WeeklySchedule + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklySchedule Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicyV2Internal.WeeklySchedule { get => (this._weeklySchedule = this._weeklySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklySchedule()); set { {_weeklySchedule = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType? _scheduleRunFrequency; + + /// Frequency of the schedule operation of this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType? ScheduleRunFrequency { get => this._scheduleRunFrequency; set => this._scheduleRunFrequency = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)__schedulePolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)__schedulePolicy).Type = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklySchedule _weeklySchedule; + + /// Weekly schedule of this policy + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklySchedule WeeklySchedule { get => (this._weeklySchedule = this._weeklySchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklySchedule()); set => this._weeklySchedule = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] WeeklyScheduleRunDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyScheduleInternal)WeeklySchedule).ScheduleRunDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyScheduleInternal)WeeklySchedule).ScheduleRunDay = value ?? null /* arrayOf */; } + + /// List of times of day this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public global::System.DateTime[] WeeklyScheduleRunTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyScheduleInternal)WeeklySchedule).ScheduleRunTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyScheduleInternal)WeeklySchedule).ScheduleRunTime = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public SimpleSchedulePolicyV2() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__schedulePolicy), __schedulePolicy); + await eventListener.AssertObjectIsValid(nameof(__schedulePolicy), __schedulePolicy); + } + } + /// The V2 policy schedule for IaaS that supports hourly backups. + public partial interface ISimpleSchedulePolicyV2 : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy + { + /// List of times of day this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of times of day this schedule has to be run.", + SerializedName = @"scheduleRunTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] DailyScheduleRunTime { get; set; } + /// + /// Interval at which backup needs to be triggered. For hourly the value + /// can be 4/6/8/12 + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Interval at which backup needs to be triggered. For hourly the value + can be 4/6/8/12", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(int) })] + int? HourlyScheduleInterval { get; set; } + /// To specify duration of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To specify duration of the backup window", + SerializedName = @"scheduleWindowDuration", + PossibleTypes = new [] { typeof(int) })] + int? HourlyScheduleWindowDuration { get; set; } + /// To specify start time of the backup window + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To specify start time of the backup window", + SerializedName = @"scheduleWindowStartTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? HourlyScheduleWindowStartTime { get; set; } + /// Frequency of the schedule operation of this policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Frequency of the schedule operation of this policy.", + SerializedName = @"scheduleRunFrequency", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType? ScheduleRunFrequency { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"scheduleRunDays", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] WeeklyScheduleRunDay { get; set; } + /// List of times of day this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of times of day this schedule has to be run.", + SerializedName = @"scheduleRunTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] WeeklyScheduleRunTime { get; set; } + + } + /// The V2 policy schedule for IaaS that supports hourly backups. + internal partial interface ISimpleSchedulePolicyV2Internal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal + { + /// Daily schedule of this policy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailySchedule DailySchedule { get; set; } + /// List of times of day this schedule has to be run. + global::System.DateTime[] DailyScheduleRunTime { get; set; } + /// hourly schedule of this policy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IHourlySchedule HourlySchedule { get; set; } + /// + /// Interval at which backup needs to be triggered. For hourly the value + /// can be 4/6/8/12 + /// + int? HourlyScheduleInterval { get; set; } + /// To specify duration of the backup window + int? HourlyScheduleWindowDuration { get; set; } + /// To specify start time of the backup window + global::System.DateTime? HourlyScheduleWindowStartTime { get; set; } + /// Frequency of the schedule operation of this policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType? ScheduleRunFrequency { get; set; } + /// Weekly schedule of this policy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklySchedule WeeklySchedule { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] WeeklyScheduleRunDay { get; set; } + /// List of times of day this schedule has to be run. + global::System.DateTime[] WeeklyScheduleRunTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicyV2.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicyV2.json.cs new file mode 100644 index 000000000000..3c2675b77477 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SimpleSchedulePolicyV2.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The V2 policy schedule for IaaS that supports hourly backups. + public partial class SimpleSchedulePolicyV2 + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicyV2. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicyV2. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISimpleSchedulePolicyV2 FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new SimpleSchedulePolicyV2(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal SimpleSchedulePolicyV2(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __schedulePolicy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy(json); + {_hourlySchedule = If( json?.PropertyT("hourlySchedule"), out var __jsonHourlySchedule) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.HourlySchedule.FromJson(__jsonHourlySchedule) : HourlySchedule;} + {_dailySchedule = If( json?.PropertyT("dailySchedule"), out var __jsonDailySchedule) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailySchedule.FromJson(__jsonDailySchedule) : DailySchedule;} + {_weeklySchedule = If( json?.PropertyT("weeklySchedule"), out var __jsonWeeklySchedule) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklySchedule.FromJson(__jsonWeeklySchedule) : WeeklySchedule;} + {_scheduleRunFrequency = If( json?.PropertyT("scheduleRunFrequency"), out var __jsonScheduleRunFrequency) ? (string)__jsonScheduleRunFrequency : (string)ScheduleRunFrequency;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __schedulePolicy?.ToJson(container, serializationMode); + AddIf( null != this._hourlySchedule ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._hourlySchedule.ToJson(null,serializationMode) : null, "hourlySchedule" ,container.Add ); + AddIf( null != this._dailySchedule ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._dailySchedule.ToJson(null,serializationMode) : null, "dailySchedule" ,container.Add ); + AddIf( null != this._weeklySchedule ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._weeklySchedule.ToJson(null,serializationMode) : null, "weeklySchedule" ,container.Add ); + AddIf( null != (((object)this._scheduleRunFrequency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._scheduleRunFrequency.ToString()) : null, "scheduleRunFrequency" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectory.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectory.cs new file mode 100644 index 000000000000..ad921843a9b9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectory.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// SQLDataDirectory info + public partial class SqlDataDirectory : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryInternal + { + + /// Backing field for property. + private string _logicalName; + + /// Logical name of the file + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string LogicalName { get => this._logicalName; set => this._logicalName = value; } + + /// Backing field for property. + private string _path; + + /// File path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Path { get => this._path; set => this._path = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType? _type; + + /// Type of data directory mapping + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public SqlDataDirectory() + { + + } + } + /// SQLDataDirectory info + public partial interface ISqlDataDirectory : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Logical name of the file + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logical name of the file", + SerializedName = @"logicalName", + PossibleTypes = new [] { typeof(string) })] + string LogicalName { get; set; } + /// File path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File path", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + /// Type of data directory mapping + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of data directory mapping", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType? Type { get; set; } + + } + /// SQLDataDirectory info + internal partial interface ISqlDataDirectoryInternal + + { + /// Logical name of the file + string LogicalName { get; set; } + /// File path + string Path { get; set; } + /// Type of data directory mapping + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectory.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectory.json.cs new file mode 100644 index 000000000000..64cccca6857c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectory.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// SQLDataDirectory info + public partial class SqlDataDirectory + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectory FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new SqlDataDirectory(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal SqlDataDirectory(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + {_logicalName = If( json?.PropertyT("logicalName"), out var __jsonLogicalName) ? (string)__jsonLogicalName : (string)LogicalName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); + AddIf( null != (((object)this._logicalName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._logicalName.ToString()) : null, "logicalName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectoryMapping.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectoryMapping.cs new file mode 100644 index 000000000000..d67df8b44e1b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectoryMapping.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Encapsulates information regarding data directory + public partial class SqlDataDirectoryMapping : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMappingInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType? _mappingType; + + /// Type of data directory mapping + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType? MappingType { get => this._mappingType; set => this._mappingType = value; } + + /// Backing field for property. + private string _sourceLogicalName; + + /// Restore source logical name path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceLogicalName { get => this._sourceLogicalName; set => this._sourceLogicalName = value; } + + /// Backing field for property. + private string _sourcePath; + + /// Restore source path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourcePath { get => this._sourcePath; set => this._sourcePath = value; } + + /// Backing field for property. + private string _targetPath; + + /// Target path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetPath { get => this._targetPath; set => this._targetPath = value; } + + /// Creates an new instance. + public SqlDataDirectoryMapping() + { + + } + } + /// Encapsulates information regarding data directory + public partial interface ISqlDataDirectoryMapping : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Type of data directory mapping + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of data directory mapping", + SerializedName = @"mappingType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType? MappingType { get; set; } + /// Restore source logical name path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restore source logical name path", + SerializedName = @"sourceLogicalName", + PossibleTypes = new [] { typeof(string) })] + string SourceLogicalName { get; set; } + /// Restore source path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restore source path", + SerializedName = @"sourcePath", + PossibleTypes = new [] { typeof(string) })] + string SourcePath { get; set; } + /// Target path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target path", + SerializedName = @"targetPath", + PossibleTypes = new [] { typeof(string) })] + string TargetPath { get; set; } + + } + /// Encapsulates information regarding data directory + internal partial interface ISqlDataDirectoryMappingInternal + + { + /// Type of data directory mapping + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType? MappingType { get; set; } + /// Restore source logical name path + string SourceLogicalName { get; set; } + /// Restore source path + string SourcePath { get; set; } + /// Target path + string TargetPath { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectoryMapping.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectoryMapping.json.cs new file mode 100644 index 000000000000..2b874d3ba018 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SqlDataDirectoryMapping.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Encapsulates information regarding data directory + public partial class SqlDataDirectoryMapping + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISqlDataDirectoryMapping FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new SqlDataDirectoryMapping(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal SqlDataDirectoryMapping(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_mappingType = If( json?.PropertyT("mappingType"), out var __jsonMappingType) ? (string)__jsonMappingType : (string)MappingType;} + {_sourceLogicalName = If( json?.PropertyT("sourceLogicalName"), out var __jsonSourceLogicalName) ? (string)__jsonSourceLogicalName : (string)SourceLogicalName;} + {_sourcePath = If( json?.PropertyT("sourcePath"), out var __jsonSourcePath) ? (string)__jsonSourcePath : (string)SourcePath;} + {_targetPath = If( json?.PropertyT("targetPath"), out var __jsonTargetPath) ? (string)__jsonTargetPath : (string)TargetPath;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._mappingType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._mappingType.ToString()) : null, "mappingType" ,container.Add ); + AddIf( null != (((object)this._sourceLogicalName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceLogicalName.ToString()) : null, "sourceLogicalName" ,container.Add ); + AddIf( null != (((object)this._sourcePath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourcePath.ToString()) : null, "sourcePath" ,container.Add ); + AddIf( null != (((object)this._targetPath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetPath.ToString()) : null, "targetPath" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicy.cs new file mode 100644 index 000000000000..b1be6f7deea2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicy.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Sub-protection policy which includes schedule and retention + public partial class SubProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyInternal + { + + /// Internal Acessors for RetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyInternal.RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy()); set { {_retentionPolicy = value;} } } + + /// Internal Acessors for SchedulePolicy + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyInternal.SchedulePolicy { get => (this._schedulePolicy = this._schedulePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy()); set { {_schedulePolicy = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType? _policyType; + + /// Type of backup policy type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType? PolicyType { get => this._policyType; set => this._policyType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy _retentionPolicy; + + /// Retention policy with the details on backup copy retention ranges. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy()); set => this._retentionPolicy = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RetentionPolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)RetentionPolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicyInternal)RetentionPolicy).Type = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy _schedulePolicy; + + /// Backup schedule specified as part of backup policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy SchedulePolicy { get => (this._schedulePolicy = this._schedulePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy()); set => this._schedulePolicy = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string SchedulePolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)SchedulePolicy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicyInternal)SchedulePolicy).Type = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyTieringPolicy _tieringPolicy; + + /// + /// Tiering policy to automatically move RPs to another tier. + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyTieringPolicy TieringPolicy { get => (this._tieringPolicy = this._tieringPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SubProtectionPolicyTieringPolicy()); set => this._tieringPolicy = value; } + + /// Creates an new instance. + public SubProtectionPolicy() + { + + } + } + /// Sub-protection policy which includes schedule and retention + public partial interface ISubProtectionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Type of backup policy type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup policy type", + SerializedName = @"policyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType? PolicyType { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"retentionPolicyType", + PossibleTypes = new [] { typeof(string) })] + string RetentionPolicyType { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"schedulePolicyType", + PossibleTypes = new [] { typeof(string) })] + string SchedulePolicyType { get; set; } + /// + /// Tiering policy to automatically move RPs to another tier. + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tiering policy to automatically move RPs to another tier. + Key is Target Tier, defined in RecoveryPointTierType enum. + Tiering policy specifies the criteria to move RP to the target tier.", + SerializedName = @"tieringPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyTieringPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyTieringPolicy TieringPolicy { get; set; } + + } + /// Sub-protection policy which includes schedule and retention + internal partial interface ISubProtectionPolicyInternal + + { + /// Type of backup policy type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType? PolicyType { get; set; } + /// Retention policy with the details on backup copy retention ranges. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionPolicy RetentionPolicy { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string RetentionPolicyType { get; set; } + /// Backup schedule specified as part of backup policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISchedulePolicy SchedulePolicy { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string SchedulePolicyType { get; set; } + /// + /// Tiering policy to automatically move RPs to another tier. + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyTieringPolicy TieringPolicy { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicy.json.cs new file mode 100644 index 000000000000..d92ea34874da --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Sub-protection policy which includes schedule and retention + public partial class SubProtectionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new SubProtectionPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal SubProtectionPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_schedulePolicy = If( json?.PropertyT("schedulePolicy"), out var __jsonSchedulePolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SchedulePolicy.FromJson(__jsonSchedulePolicy) : SchedulePolicy;} + {_retentionPolicy = If( json?.PropertyT("retentionPolicy"), out var __jsonRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionPolicy.FromJson(__jsonRetentionPolicy) : RetentionPolicy;} + {_policyType = If( json?.PropertyT("policyType"), out var __jsonPolicyType) ? (string)__jsonPolicyType : (string)PolicyType;} + {_tieringPolicy = If( json?.PropertyT("tieringPolicy"), out var __jsonTieringPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SubProtectionPolicyTieringPolicy.FromJson(__jsonTieringPolicy) : TieringPolicy;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._schedulePolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._schedulePolicy.ToJson(null,serializationMode) : null, "schedulePolicy" ,container.Add ); + AddIf( null != this._retentionPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionPolicy.ToJson(null,serializationMode) : null, "retentionPolicy" ,container.Add ); + AddIf( null != (((object)this._policyType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyType.ToString()) : null, "policyType" ,container.Add ); + AddIf( null != this._tieringPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._tieringPolicy.ToJson(null,serializationMode) : null, "tieringPolicy" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.cs new file mode 100644 index 000000000000..b5f2d24d6c15 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Tiering policy to automatically move RPs to another tier. + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + /// + public partial class SubProtectionPolicyTieringPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyTieringPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyTieringPolicyInternal + { + + /// Creates an new instance. + public SubProtectionPolicyTieringPolicy() + { + + } + } + /// Tiering policy to automatically move RPs to another tier. + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + public partial interface ISubProtectionPolicyTieringPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Tiering policy to automatically move RPs to another tier. + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + internal partial interface ISubProtectionPolicyTieringPolicyInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.dictionary.cs new file mode 100644 index 000000000000..7af041115bb0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class SubProtectionPolicyTieringPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicy this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicy value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicy value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.SubProtectionPolicyTieringPolicy source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.json.cs new file mode 100644 index 000000000000..c2ebac85eeea --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/SubProtectionPolicyTieringPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Tiering policy to automatically move RPs to another tier. + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. + /// + public partial class SubProtectionPolicyTieringPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyTieringPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyTieringPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISubProtectionPolicyTieringPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new SubProtectionPolicyTieringPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal SubProtectionPolicyTieringPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.TieringPolicy.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetAfsRestoreInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetAfsRestoreInfo.cs new file mode 100644 index 000000000000..ef65371c0b49 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetAfsRestoreInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Target Azure File Share Info. + public partial class TargetAfsRestoreInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfoInternal + { + + /// Backing field for property. + private string _name; + + /// File share name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _targetResourceId; + + /// Target file share resource ARM ID + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetResourceId { get => this._targetResourceId; set => this._targetResourceId = value; } + + /// Creates an new instance. + public TargetAfsRestoreInfo() + { + + } + } + /// Target Azure File Share Info. + public partial interface ITargetAfsRestoreInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// File share name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"File share name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Target file share resource ARM ID + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target file share resource ARM ID", + SerializedName = @"targetResourceId", + PossibleTypes = new [] { typeof(string) })] + string TargetResourceId { get; set; } + + } + /// Target Azure File Share Info. + internal partial interface ITargetAfsRestoreInfoInternal + + { + /// File share name + string Name { get; set; } + /// Target file share resource ARM ID + string TargetResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetAfsRestoreInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetAfsRestoreInfo.json.cs new file mode 100644 index 000000000000..03d2a2ead5c4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetAfsRestoreInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Target Azure File Share Info. + public partial class TargetAfsRestoreInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetAfsRestoreInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new TargetAfsRestoreInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal TargetAfsRestoreInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_targetResourceId = If( json?.PropertyT("targetResourceId"), out var __jsonTargetResourceId) ? (string)__jsonTargetResourceId : (string)TargetResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._targetResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetResourceId.ToString()) : null, "targetResourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetRestoreInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetRestoreInfo.cs new file mode 100644 index 000000000000..240c0b0a7115 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetRestoreInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Details about target workload during restore operation. + public partial class TargetRestoreInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfoInternal + { + + /// Backing field for property. + private string _containerId; + + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerId { get => this._containerId; set => this._containerId = value; } + + /// Backing field for property. + private string _databaseName; + + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DatabaseName { get => this._databaseName; set => this._databaseName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? _overwriteOption; + + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? OverwriteOption { get => this._overwriteOption; set => this._overwriteOption = value; } + + /// Backing field for property. + private string _targetDirectoryForFileRestore; + + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TargetDirectoryForFileRestore { get => this._targetDirectoryForFileRestore; set => this._targetDirectoryForFileRestore = value; } + + /// Creates an new instance. + public TargetRestoreInfo() + { + + } + } + /// Details about target workload during restore operation. + public partial interface ITargetRestoreInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Resource Id name of the container in which Target DataBase resides + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id name of the container in which Target DataBase resides", + SerializedName = @"containerId", + PossibleTypes = new [] { typeof(string) })] + string ContainerId { get; set; } + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana", + SerializedName = @"databaseName", + PossibleTypes = new [] { typeof(string) })] + string DatabaseName { get; set; } + /// Can Overwrite if Target DataBase already exists + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can Overwrite if Target DataBase already exists", + SerializedName = @"overwriteOption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? OverwriteOption { get; set; } + /// Target directory location for restore as files. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target directory location for restore as files.", + SerializedName = @"targetDirectoryForFileRestore", + PossibleTypes = new [] { typeof(string) })] + string TargetDirectoryForFileRestore { get; set; } + + } + /// Details about target workload during restore operation. + internal partial interface ITargetRestoreInfoInternal + + { + /// Resource Id name of the container in which Target DataBase resides + string ContainerId { get; set; } + /// Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + string DatabaseName { get; set; } + /// Can Overwrite if Target DataBase already exists + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions? OverwriteOption { get; set; } + /// Target directory location for restore as files. + string TargetDirectoryForFileRestore { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetRestoreInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetRestoreInfo.json.cs new file mode 100644 index 000000000000..a8fede324eba --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TargetRestoreInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Details about target workload during restore operation. + public partial class TargetRestoreInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITargetRestoreInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new TargetRestoreInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal TargetRestoreInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_overwriteOption = If( json?.PropertyT("overwriteOption"), out var __jsonOverwriteOption) ? (string)__jsonOverwriteOption : (string)OverwriteOption;} + {_containerId = If( json?.PropertyT("containerId"), out var __jsonContainerId) ? (string)__jsonContainerId : (string)ContainerId;} + {_databaseName = If( json?.PropertyT("databaseName"), out var __jsonDatabaseName) ? (string)__jsonDatabaseName : (string)DatabaseName;} + {_targetDirectoryForFileRestore = If( json?.PropertyT("targetDirectoryForFileRestore"), out var __jsonTargetDirectoryForFileRestore) ? (string)__jsonTargetDirectoryForFileRestore : (string)TargetDirectoryForFileRestore;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._overwriteOption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._overwriteOption.ToString()) : null, "overwriteOption" ,container.Add ); + AddIf( null != (((object)this._containerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerId.ToString()) : null, "containerId" ,container.Add ); + AddIf( null != (((object)this._databaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._databaseName.ToString()) : null, "databaseName" ,container.Add ); + AddIf( null != (((object)this._targetDirectoryForFileRestore)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._targetDirectoryForFileRestore.ToString()) : null, "targetDirectoryForFileRestore" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TieringPolicy.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TieringPolicy.cs new file mode 100644 index 000000000000..470a8b5cbb38 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TieringPolicy.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Tiering Policy for a target tier. + /// If the policy is not specified for a given target tier, service retains the existing configured tiering policy for that + /// tier + /// + public partial class TieringPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicy, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicyInternal + { + + /// Backing field for property. + private int? _duration; + + /// + /// Number of days/weeks/months/years to retain backups in current tier before tiering. + /// Used only if TieringMode is set to TierAfter + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? Duration { get => this._duration; set => this._duration = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? _durationType; + + /// + /// Retention duration type: days/weeks/months/years + /// Used only if TieringMode is set to TierAfter + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? DurationType { get => this._durationType; set => this._durationType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode? _tieringMode; + + /// + /// Tiering Mode to control automatic tiering of recovery points. Supported values are: + /// 1. TierRecommended: Tier all recovery points recommended to be tiered + /// 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. + /// 3. DoNotTier: Do not tier any recovery points + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode? TieringMode { get => this._tieringMode; set => this._tieringMode = value; } + + /// Creates an new instance. + public TieringPolicy() + { + + } + } + /// Tiering Policy for a target tier. + /// If the policy is not specified for a given target tier, service retains the existing configured tiering policy for that + /// tier + public partial interface ITieringPolicy : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// Number of days/weeks/months/years to retain backups in current tier before tiering. + /// Used only if TieringMode is set to TierAfter + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of days/weeks/months/years to retain backups in current tier before tiering. + Used only if TieringMode is set to TierAfter", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(int) })] + int? Duration { get; set; } + /// + /// Retention duration type: days/weeks/months/years + /// Used only if TieringMode is set to TierAfter + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type: days/weeks/months/years + Used only if TieringMode is set to TierAfter", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? DurationType { get; set; } + /// + /// Tiering Mode to control automatic tiering of recovery points. Supported values are: + /// 1. TierRecommended: Tier all recovery points recommended to be tiered + /// 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. + /// 3. DoNotTier: Do not tier any recovery points + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tiering Mode to control automatic tiering of recovery points. Supported values are: + 1. TierRecommended: Tier all recovery points recommended to be tiered + 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. + 3. DoNotTier: Do not tier any recovery points", + SerializedName = @"tieringMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode? TieringMode { get; set; } + + } + /// Tiering Policy for a target tier. + /// If the policy is not specified for a given target tier, service retains the existing configured tiering policy for that + /// tier + internal partial interface ITieringPolicyInternal + + { + /// + /// Number of days/weeks/months/years to retain backups in current tier before tiering. + /// Used only if TieringMode is set to TierAfter + /// + int? Duration { get; set; } + /// + /// Retention duration type: days/weeks/months/years + /// Used only if TieringMode is set to TierAfter + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? DurationType { get; set; } + /// + /// Tiering Mode to control automatic tiering of recovery points. Supported values are: + /// 1. TierRecommended: Tier all recovery points recommended to be tiered + /// 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. + /// 3. DoNotTier: Do not tier any recovery points + /// + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode? TieringMode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TieringPolicy.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TieringPolicy.json.cs new file mode 100644 index 000000000000..dba821e94f81 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TieringPolicy.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Tiering Policy for a target tier. + /// If the policy is not specified for a given target tier, service retains the existing configured tiering policy for that + /// tier + /// + public partial class TieringPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITieringPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new TieringPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal TieringPolicy(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tieringMode = If( json?.PropertyT("tieringMode"), out var __jsonTieringMode) ? (string)__jsonTieringMode : (string)TieringMode;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? (int?)__jsonDuration : Duration;} + {_durationType = If( json?.PropertyT("durationType"), out var __jsonDurationType) ? (string)__jsonDurationType : (string)DurationType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._tieringMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._tieringMode.ToString()) : null, "tieringMode" ,container.Add ); + AddIf( null != this._duration ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._duration) : null, "duration" ,container.Add ); + AddIf( null != (((object)this._durationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._durationType.ToString()) : null, "durationType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TokenInformation.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TokenInformation.cs new file mode 100644 index 000000000000..4d2570e47614 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TokenInformation.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The token information details. + public partial class TokenInformation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITokenInformation, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITokenInformationInternal + { + + /// Backing field for property. + private long? _expiryTimeInUtcTick; + + /// Expiry time of token. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? ExpiryTimeInUtcTick { get => this._expiryTimeInUtcTick; set => this._expiryTimeInUtcTick = value; } + + /// Backing field for property. + private string _securityPin; + + /// Security PIN + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SecurityPin { get => this._securityPin; set => this._securityPin = value; } + + /// Backing field for property. + private string _token; + + /// Token value. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Token { get => this._token; set => this._token = value; } + + /// Creates an new instance. + public TokenInformation() + { + + } + } + /// The token information details. + public partial interface ITokenInformation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Expiry time of token. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiry time of token.", + SerializedName = @"expiryTimeInUtcTicks", + PossibleTypes = new [] { typeof(long) })] + long? ExpiryTimeInUtcTick { get; set; } + /// Security PIN + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Security PIN", + SerializedName = @"securityPIN", + PossibleTypes = new [] { typeof(string) })] + string SecurityPin { get; set; } + /// Token value. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Token value.", + SerializedName = @"token", + PossibleTypes = new [] { typeof(string) })] + string Token { get; set; } + + } + /// The token information details. + internal partial interface ITokenInformationInternal + + { + /// Expiry time of token. + long? ExpiryTimeInUtcTick { get; set; } + /// Security PIN + string SecurityPin { get; set; } + /// Token value. + string Token { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TokenInformation.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TokenInformation.json.cs new file mode 100644 index 000000000000..dfd0a42d9101 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TokenInformation.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The token information details. + public partial class TokenInformation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITokenInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITokenInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITokenInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new TokenInformation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._token)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._token.ToString()) : null, "token" ,container.Add ); + AddIf( null != this._expiryTimeInUtcTick ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._expiryTimeInUtcTick) : null, "expiryTimeInUtcTicks" ,container.Add ); + AddIf( null != (((object)this._securityPin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._securityPin.ToString()) : null, "securityPIN" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal TokenInformation(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_token = If( json?.PropertyT("token"), out var __jsonToken) ? (string)__jsonToken : (string)Token;} + {_expiryTimeInUtcTick = If( json?.PropertyT("expiryTimeInUtcTicks"), out var __jsonExpiryTimeInUtcTicks) ? (long?)__jsonExpiryTimeInUtcTicks : ExpiryTimeInUtcTick;} + {_securityPin = If( json?.PropertyT("securityPIN"), out var __jsonSecurityPin) ? (string)__jsonSecurityPin : (string)SecurityPin;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TriggerDataMoveRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TriggerDataMoveRequest.cs new file mode 100644 index 000000000000..4598b40df04e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TriggerDataMoveRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Trigger DataMove Request + public partial class TriggerDataMoveRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITriggerDataMoveRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITriggerDataMoveRequestInternal + { + + /// Backing field for property. + private string _correlationId; + + /// Correlation Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string CorrelationId { get => this._correlationId; set => this._correlationId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel _dataMoveLevel; + + /// DataMove Level + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel DataMoveLevel { get => this._dataMoveLevel; set => this._dataMoveLevel = value; } + + /// Backing field for property. + private bool? _pauseGc; + + /// Pause GC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? PauseGc { get => this._pauseGc; set => this._pauseGc = value; } + + /// Backing field for property. + private string[] _sourceContainerArmId; + + /// Source Container ArmIds + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] SourceContainerArmId { get => this._sourceContainerArmId; set => this._sourceContainerArmId = value; } + + /// Backing field for property. + private string _sourceRegion; + + /// Source Region + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceRegion { get => this._sourceRegion; set => this._sourceRegion = value; } + + /// Backing field for property. + private string _sourceResourceId; + + /// ARM Id of source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Creates an new instance. + public TriggerDataMoveRequest() + { + + } + } + /// Trigger DataMove Request + public partial interface ITriggerDataMoveRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Correlation Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Correlation Id", + SerializedName = @"correlationId", + PossibleTypes = new [] { typeof(string) })] + string CorrelationId { get; set; } + /// DataMove Level + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"DataMove Level", + SerializedName = @"dataMoveLevel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel DataMoveLevel { get; set; } + /// Pause GC + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Pause GC", + SerializedName = @"pauseGC", + PossibleTypes = new [] { typeof(bool) })] + bool? PauseGc { get; set; } + /// Source Container ArmIds + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source Container ArmIds", + SerializedName = @"sourceContainerArmIds", + PossibleTypes = new [] { typeof(string) })] + string[] SourceContainerArmId { get; set; } + /// Source Region + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Source Region", + SerializedName = @"sourceRegion", + PossibleTypes = new [] { typeof(string) })] + string SourceRegion { get; set; } + /// ARM Id of source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ARM Id of source vault", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + + } + /// Trigger DataMove Request + internal partial interface ITriggerDataMoveRequestInternal + + { + /// Correlation Id + string CorrelationId { get; set; } + /// DataMove Level + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel DataMoveLevel { get; set; } + /// Pause GC + bool? PauseGc { get; set; } + /// Source Container ArmIds + string[] SourceContainerArmId { get; set; } + /// Source Region + string SourceRegion { get; set; } + /// ARM Id of source vault + string SourceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TriggerDataMoveRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TriggerDataMoveRequest.json.cs new file mode 100644 index 000000000000..d237ee7608b8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/TriggerDataMoveRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Trigger DataMove Request + public partial class TriggerDataMoveRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITriggerDataMoveRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITriggerDataMoveRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITriggerDataMoveRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new TriggerDataMoveRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + AddIf( null != (((object)this._sourceRegion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._sourceRegion.ToString()) : null, "sourceRegion" ,container.Add ); + AddIf( null != (((object)this._dataMoveLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._dataMoveLevel.ToString()) : null, "dataMoveLevel" ,container.Add ); + AddIf( null != (((object)this._correlationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._correlationId.ToString()) : null, "correlationId" ,container.Add ); + if (null != this._sourceContainerArmId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._sourceContainerArmId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("sourceContainerArmIds",__w); + } + AddIf( null != this._pauseGc ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._pauseGc) : null, "pauseGC" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal TriggerDataMoveRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + {_sourceRegion = If( json?.PropertyT("sourceRegion"), out var __jsonSourceRegion) ? (string)__jsonSourceRegion : (string)SourceRegion;} + {_dataMoveLevel = If( json?.PropertyT("dataMoveLevel"), out var __jsonDataMoveLevel) ? (string)__jsonDataMoveLevel : (string)DataMoveLevel;} + {_correlationId = If( json?.PropertyT("correlationId"), out var __jsonCorrelationId) ? (string)__jsonCorrelationId : (string)CorrelationId;} + {_sourceContainerArmId = If( json?.PropertyT("sourceContainerArmIds"), out var __jsonSourceContainerArmIds) ? If( __jsonSourceContainerArmIds as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SourceContainerArmId;} + {_pauseGc = If( json?.PropertyT("pauseGC"), out var __jsonPauseGc) ? (bool?)__jsonPauseGc : PauseGc;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteRequest.cs new file mode 100644 index 000000000000..49224d352b34 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Request body of unlock delete API. + public partial class UnlockDeleteRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteRequestInternal + { + + /// Backing field for property. + private string[] _resourceGuardOperationRequest; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] ResourceGuardOperationRequest { get => this._resourceGuardOperationRequest; set => this._resourceGuardOperationRequest = value; } + + /// Backing field for property. + private string _resourceToBeDeleted; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceToBeDeleted { get => this._resourceToBeDeleted; set => this._resourceToBeDeleted = value; } + + /// Creates an new instance. + public UnlockDeleteRequest() + { + + } + } + /// Request body of unlock delete API. + public partial interface IUnlockDeleteRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"resourceGuardOperationRequests", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceGuardOperationRequest { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"resourceToBeDeleted", + PossibleTypes = new [] { typeof(string) })] + string ResourceToBeDeleted { get; set; } + + } + /// Request body of unlock delete API. + internal partial interface IUnlockDeleteRequestInternal + + { + string[] ResourceGuardOperationRequest { get; set; } + + string ResourceToBeDeleted { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteRequest.json.cs new file mode 100644 index 000000000000..acb00f43d63a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Request body of unlock delete API. + public partial class UnlockDeleteRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new UnlockDeleteRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._resourceGuardOperationRequest) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._resourceGuardOperationRequest ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("resourceGuardOperationRequests",__w); + } + AddIf( null != (((object)this._resourceToBeDeleted)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceToBeDeleted.ToString()) : null, "resourceToBeDeleted" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal UnlockDeleteRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceGuardOperationRequest = If( json?.PropertyT("resourceGuardOperationRequests"), out var __jsonResourceGuardOperationRequests) ? If( __jsonResourceGuardOperationRequests as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ResourceGuardOperationRequest;} + {_resourceToBeDeleted = If( json?.PropertyT("resourceToBeDeleted"), out var __jsonResourceToBeDeleted) ? (string)__jsonResourceToBeDeleted : (string)ResourceToBeDeleted;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteResponse.cs new file mode 100644 index 000000000000..e4759357767d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteResponse.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Response of Unlock Delete API. + public partial class UnlockDeleteResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteResponseInternal + { + + /// Backing field for property. + private string _unlockDeleteExpiryTime; + + /// This is the time when unlock delete privileges will get expired. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string UnlockDeleteExpiryTime { get => this._unlockDeleteExpiryTime; set => this._unlockDeleteExpiryTime = value; } + + /// Creates an new instance. + public UnlockDeleteResponse() + { + + } + } + /// Response of Unlock Delete API. + public partial interface IUnlockDeleteResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// This is the time when unlock delete privileges will get expired. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the time when unlock delete privileges will get expired.", + SerializedName = @"unlockDeleteExpiryTime", + PossibleTypes = new [] { typeof(string) })] + string UnlockDeleteExpiryTime { get; set; } + + } + /// Response of Unlock Delete API. + internal partial interface IUnlockDeleteResponseInternal + + { + /// This is the time when unlock delete privileges will get expired. + string UnlockDeleteExpiryTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteResponse.json.cs new file mode 100644 index 000000000000..87e9f36e5688 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/UnlockDeleteResponse.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Response of Unlock Delete API. + public partial class UnlockDeleteResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new UnlockDeleteResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._unlockDeleteExpiryTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._unlockDeleteExpiryTime.ToString()) : null, "unlockDeleteExpiryTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal UnlockDeleteResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_unlockDeleteExpiryTime = If( json?.PropertyT("unlockDeleteExpiryTime"), out var __jsonUnlockDeleteExpiryTime) ? (string)__jsonUnlockDeleteExpiryTime : (string)UnlockDeleteExpiryTime;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateIaasVMRestoreOperationRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateIaasVMRestoreOperationRequest.cs new file mode 100644 index 000000000000..0a3d45d84165 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateIaasVMRestoreOperationRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureRestoreValidation request. + public partial class ValidateIaasVMRestoreOperationRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateIaasVMRestoreOperationRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateIaasVMRestoreOperationRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequest __validateRestoreOperationRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateRestoreOperationRequest(); + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequestInternal)__validateRestoreOperationRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequestInternal)__validateRestoreOperationRequest).ObjectType = value ; } + + /// Sets restore request to be validated + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest RestoreRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequestInternal)__validateRestoreOperationRequest).RestoreRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequestInternal)__validateRestoreOperationRequest).RestoreRequest = value ?? null /* model class */; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RestoreRequestObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequestInternal)__validateRestoreOperationRequest).RestoreRequestObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequestInternal)__validateRestoreOperationRequest).RestoreRequestObjectType = value ?? null; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__validateRestoreOperationRequest), __validateRestoreOperationRequest); + await eventListener.AssertObjectIsValid(nameof(__validateRestoreOperationRequest), __validateRestoreOperationRequest); + } + + /// Creates an new instance. + public ValidateIaasVMRestoreOperationRequest() + { + + } + } + /// AzureRestoreValidation request. + public partial interface IValidateIaasVMRestoreOperationRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequest + { + + } + /// AzureRestoreValidation request. + internal partial interface IValidateIaasVMRestoreOperationRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequestInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateIaasVMRestoreOperationRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateIaasVMRestoreOperationRequest.json.cs new file mode 100644 index 000000000000..9fa6cc59d35d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateIaasVMRestoreOperationRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureRestoreValidation request. + public partial class ValidateIaasVMRestoreOperationRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateIaasVMRestoreOperationRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateIaasVMRestoreOperationRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateIaasVMRestoreOperationRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ValidateIaasVMRestoreOperationRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __validateRestoreOperationRequest?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateIaasVMRestoreOperationRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __validateRestoreOperationRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateRestoreOperationRequest(json); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationRequest.cs new file mode 100644 index 000000000000..d68932f06483 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for validate operation request. + public partial class ValidateOperationRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequestInternal + { + + /// Backing field for property. + private string _objectType; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Creates an new instance. + public ValidateOperationRequest() + { + + } + } + /// Base class for validate operation request. + public partial interface IValidateOperationRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Base class for validate operation request. + internal partial interface IValidateOperationRequestInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationRequest.json.cs new file mode 100644 index 000000000000..cc6e3e0395c1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationRequest.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for validate operation request. + public partial class ValidateOperationRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "ValidateRestoreOperationRequest": + { + return new ValidateRestoreOperationRequest(json); + } + case "ValidateIaasVMRestoreOperationRequest": + { + return new ValidateIaasVMRestoreOperationRequest(json); + } + } + return new ValidateOperationRequest(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateOperationRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationResponse.cs new file mode 100644 index 000000000000..8aa620bff750 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationResponse.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for validate operation response. + public partial class ValidateOperationResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponseInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail[] _validationResult; + + /// Gets the validation result + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail[] ValidationResult { get => this._validationResult; set => this._validationResult = value; } + + /// Creates an new instance. + public ValidateOperationResponse() + { + + } + } + /// Base class for validate operation response. + public partial interface IValidateOperationResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Gets the validation result + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets the validation result", + SerializedName = @"validationResults", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail[] ValidationResult { get; set; } + + } + /// Base class for validate operation response. + internal partial interface IValidateOperationResponseInternal + + { + /// Gets the validation result + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail[] ValidationResult { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationResponse.json.cs new file mode 100644 index 000000000000..03793c96f3c4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationResponse.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for validate operation response. + public partial class ValidateOperationResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ValidateOperationResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._validationResult) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._validationResult ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("validationResults",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateOperationResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_validationResult = If( json?.PropertyT("validationResults"), out var __jsonValidationResults) ? If( __jsonValidationResults as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ErrorDetail.FromJson(__u) )) ))() : null : ValidationResult;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationsResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationsResponse.cs new file mode 100644 index 000000000000..d6bdab10506c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationsResponse.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class ValidateOperationsResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationsResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationsResponseInternal + { + + /// Internal Acessors for ValidateOperationResponse + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationsResponseInternal.ValidateOperationResponse { get => (this._validateOperationResponse = this._validateOperationResponse ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateOperationResponse()); set { {_validateOperationResponse = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse _validateOperationResponse; + + /// Base class for validate operation response. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse ValidateOperationResponse { get => (this._validateOperationResponse = this._validateOperationResponse ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateOperationResponse()); set => this._validateOperationResponse = value; } + + /// Gets the validation result + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail[] ValidateOperationResponseValidationResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponseInternal)ValidateOperationResponse).ValidationResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponseInternal)ValidateOperationResponse).ValidationResult = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public ValidateOperationsResponse() + { + + } + } + public partial interface IValidateOperationsResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Gets the validation result + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets the validation result", + SerializedName = @"validationResults", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail[] ValidateOperationResponseValidationResult { get; set; } + + } + internal partial interface IValidateOperationsResponseInternal + + { + /// Base class for validate operation response. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationResponse ValidateOperationResponse { get; set; } + /// Gets the validation result + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail[] ValidateOperationResponseValidationResult { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationsResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationsResponse.json.cs new file mode 100644 index 000000000000..bbe2f2d3a470 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateOperationsResponse.json.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class ValidateOperationsResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationsResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationsResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new ValidateOperationsResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._validateOperationResponse ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._validateOperationResponse.ToJson(null,serializationMode) : null, "validateOperationResponse" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateOperationsResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_validateOperationResponse = If( json?.PropertyT("validateOperationResponse"), out var __jsonValidateOperationResponse) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateOperationResponse.FromJson(__jsonValidateOperationResponse) : ValidateOperationResponse;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateRestoreOperationRequest.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateRestoreOperationRequest.cs new file mode 100644 index 000000000000..9f1963eb4771 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateRestoreOperationRequest.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureRestoreValidation request. + public partial class ValidateRestoreOperationRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest __validateOperationRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateOperationRequest(); + + /// Internal Acessors for RestoreRequest + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequestInternal.RestoreRequest { get => (this._restoreRequest = this._restoreRequest ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest()); set { {_restoreRequest = value;} } } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequestInternal)__validateOperationRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequestInternal)__validateOperationRequest).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest _restoreRequest; + + /// Sets restore request to be validated + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest RestoreRequest { get => (this._restoreRequest = this._restoreRequest ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest()); set => this._restoreRequest = value; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RestoreRequestObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)RestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestInternal)RestoreRequest).ObjectType = value ?? null; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__validateOperationRequest), __validateOperationRequest); + await eventListener.AssertObjectIsValid(nameof(__validateOperationRequest), __validateOperationRequest); + } + + /// Creates an new instance. + public ValidateRestoreOperationRequest() + { + + } + } + /// AzureRestoreValidation request. + public partial interface IValidateRestoreOperationRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string RestoreRequestObjectType { get; set; } + + } + /// AzureRestoreValidation request. + internal partial interface IValidateRestoreOperationRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequestInternal + { + /// Sets restore request to be validated + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequest RestoreRequest { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string RestoreRequestObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateRestoreOperationRequest.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateRestoreOperationRequest.json.cs new file mode 100644 index 000000000000..748d78621e7b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/ValidateRestoreOperationRequest.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureRestoreValidation request. + public partial class ValidateRestoreOperationRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequest + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateRestoreOperationRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "ValidateIaasVMRestoreOperationRequest": + { + return new ValidateIaasVMRestoreOperationRequest(json); + } + } + return new ValidateRestoreOperationRequest(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __validateOperationRequest?.ToJson(container, serializationMode); + AddIf( null != this._restoreRequest ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._restoreRequest.ToJson(null,serializationMode) : null, "restoreRequest" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal ValidateRestoreOperationRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __validateOperationRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateOperationRequest(json); + {_restoreRequest = If( json?.PropertyT("restoreRequest"), out var __jsonRestoreRequest) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RestoreRequest.FromJson(__jsonRestoreRequest) : RestoreRequest;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJob.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJob.cs new file mode 100644 index 000000000000..af2956971f53 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJob.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Vault level Job + public partial class VaultJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] _actionsInfo; + + /// Gets or sets the state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get => this._actionsInfo; set => this._actionsInfo = value; } + + /// ActivityId of job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ActivityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).ActivityId = value ?? null; } + + /// Backup management type to execute the current job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).BackupManagementType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType)""); } + + /// Backing field for property. + private global::System.TimeSpan? _duration; + + /// Time elapsed during the execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.TimeSpan? Duration { get => this._duration; set => this._duration = value; } + + /// The end time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? EndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EndTime = value ?? default(global::System.DateTime); } + + /// Friendly name of the entity on which the current job is executing. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string EntityFriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfo[] _errorDetail; + + /// Error details on execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfo _extendedInfo; + + /// Additional information about the job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.VaultJobExtendedInfo()); set => this._extendedInfo = value; } + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoInternal)ExtendedInfo).PropertyBag = value ?? null /* model class */; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.VaultJobExtendedInfo()); set { {_extendedInfo = value;} } } + + /// The operation name. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Operation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Operation = value ?? null; } + + /// The start time. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public global::System.DateTime? StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).StartTime = value ?? default(global::System.DateTime); } + + /// Job status. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Status = value ?? null; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal)__job).Type = value ; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__job), __job); + await eventListener.AssertObjectIsValid(nameof(__job), __job); + } + + /// Creates an new instance. + public VaultJob() + { + + } + } + /// Vault level Job + public partial interface IVaultJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJob + { + /// Gets or sets the state/actions applicable on this job like cancel/retry. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the state/actions applicable on this job like cancel/retry.", + SerializedName = @"actionsInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Time elapsed during the execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time elapsed during the execution of this job.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Duration { get; set; } + /// Error details on execution of this job. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error details on execution of this job.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfo[] ErrorDetail { get; set; } + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + + } + /// Vault level Job + internal partial interface IVaultJobInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IJobInternal + { + /// Gets or sets the state/actions applicable on this job like cancel/retry. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[] ActionsInfo { get; set; } + /// Time elapsed during the execution of this job. + global::System.TimeSpan? Duration { get; set; } + /// Error details on execution of this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfo[] ErrorDetail { get; set; } + /// Additional information about the job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfo ExtendedInfo { get; set; } + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJob.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJob.json.cs new file mode 100644 index 000000000000..0d78512cdfde --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJob.json.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Vault level Job + public partial class VaultJob + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJob FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new VaultJob(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __job?.ToJson(container, serializationMode); + AddIf( null != this._extendedInfo ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._extendedInfo.ToJson(null,serializationMode) : null, "extendedInfo" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)(null != this._duration ? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._duration)): null), "duration" ,container.Add ); + if (null != this._actionsInfo) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._actionsInfo ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("actionsInfo",__w); + } + if (null != this._errorDetail) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._errorDetail ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("errorDetails",__r); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal VaultJob(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.VaultJobExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonDuration ) : Duration;} + {_actionsInfo = If( json?.PropertyT("actionsInfo"), out var __jsonActionsInfo) ? If( __jsonActionsInfo as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction)""))) ))() : null : ActionsInfo;} + {_errorDetail = If( json?.PropertyT("errorDetails"), out var __jsonErrorDetails) ? If( __jsonErrorDetails as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.VaultJobErrorInfo.FromJson(__p) )) ))() : null : ErrorDetail;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobErrorInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobErrorInfo.cs new file mode 100644 index 000000000000..4dabddc8652a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobErrorInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Vault Job specific error information + public partial class VaultJobErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfoInternal + { + + /// Backing field for property. + private int? _errorCode; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public int? ErrorCode { get => this._errorCode; set => this._errorCode = value; } + + /// Backing field for property. + private string _errorString; + + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ErrorString { get => this._errorString; set => this._errorString = value; } + + /// Backing field for property. + private string[] _recommendation; + + /// List of localized recommendations for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; set => this._recommendation = value; } + + /// Creates an new instance. + public VaultJobErrorInfo() + { + + } + } + /// Vault Job specific error information + public partial interface IVaultJobErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(int) })] + int? ErrorCode { get; set; } + /// Localized error string. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Localized error string.", + SerializedName = @"errorString", + PossibleTypes = new [] { typeof(string) })] + string ErrorString { get; set; } + /// List of localized recommendations for above error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of localized recommendations for above error code.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; set; } + + } + /// Vault Job specific error information + internal partial interface IVaultJobErrorInfoInternal + + { + /// Error code. + int? ErrorCode { get; set; } + /// Localized error string. + string ErrorString { get; set; } + /// List of localized recommendations for above error code. + string[] Recommendation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobErrorInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobErrorInfo.json.cs new file mode 100644 index 000000000000..5f1adf4078f6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobErrorInfo.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Vault Job specific error information + public partial class VaultJobErrorInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobErrorInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new VaultJobErrorInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._errorCode ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((int)this._errorCode) : null, "errorCode" ,container.Add ); + AddIf( null != (((object)this._errorString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._errorString.ToString()) : null, "errorString" ,container.Add ); + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal VaultJobErrorInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (int?)__jsonErrorCode : ErrorCode;} + {_errorString = If( json?.PropertyT("errorString"), out var __jsonErrorString) ? (string)__jsonErrorString : (string)ErrorString;} + {_recommendation = If( json?.PropertyT("recommendations"), out var __jsonRecommendations) ? If( __jsonRecommendations as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Recommendation;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfo.cs new file mode 100644 index 000000000000..db6134449ce7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfo.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Vault Job for CMK - has CMK specific info. + public partial class VaultJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag _propertyBag; + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.VaultJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Creates an new instance. + public VaultJobExtendedInfo() + { + + } + } + /// Vault Job for CMK - has CMK specific info. + public partial interface IVaultJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job properties.", + SerializedName = @"propertyBag", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag PropertyBag { get; set; } + + } + /// Vault Job for CMK - has CMK specific info. + internal partial interface IVaultJobExtendedInfoInternal + + { + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag PropertyBag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfo.json.cs new file mode 100644 index 000000000000..53052352766e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfo.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Vault Job for CMK - has CMK specific info. + public partial class VaultJobExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new VaultJobExtendedInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._propertyBag ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._propertyBag.ToJson(null,serializationMode) : null, "propertyBag" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal VaultJobExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.VaultJobExtendedInfoPropertyBag.FromJson(__jsonPropertyBag) : PropertyBag;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..39630af65bce --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class VaultJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBagInternal + { + + /// Creates an new instance. + public VaultJobExtendedInfoPropertyBag() + { + + } + } + /// Job properties. + public partial interface IVaultJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Job properties. + internal partial interface IVaultJobExtendedInfoPropertyBagInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..ae10c1453618 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.dictionary.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class VaultJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.VaultJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..afac5a5b6c72 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultJobExtendedInfoPropertyBag.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class VaultJobExtendedInfoPropertyBag + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultJobExtendedInfoPropertyBag FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new VaultJobExtendedInfoPropertyBag(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + /// + internal VaultJobExtendedInfoPropertyBag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultStorageConfigOperationResultResponse.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultStorageConfigOperationResultResponse.cs new file mode 100644 index 000000000000..af6d8e4b4c2e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultStorageConfigOperationResultResponse.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation result response for Vault Storage Config + public partial class VaultStorageConfigOperationResultResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponseInternal + { + + /// Backing field for property. + private string _objectType; + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// + /// Creates an new instance. + /// + public VaultStorageConfigOperationResultResponse() + { + + } + } + /// Operation result response for Vault Storage Config + public partial interface IVaultStorageConfigOperationResultResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Operation result response for Vault Storage Config + internal partial interface IVaultStorageConfigOperationResultResponseInternal + + { + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultStorageConfigOperationResultResponse.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultStorageConfigOperationResultResponse.json.cs new file mode 100644 index 000000000000..6327cf7020c0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/VaultStorageConfigOperationResultResponse.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation result response for Vault Storage Config + public partial class VaultStorageConfigOperationResultResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponse. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponse + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IVaultStorageConfigOperationResultResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("objectType") ) + { + case "PrepareDataMoveResponse": + { + return new PrepareDataMoveResponse(json); + } + } + return new VaultStorageConfigOperationResultResponse(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal VaultStorageConfigOperationResultResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionFormat.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionFormat.cs new file mode 100644 index 000000000000..9c9327bef377 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionFormat.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Weekly retention format. + public partial class WeeklyRetentionFormat : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormatInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] _daysOfTheWeek; + + /// List of days of the week. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] DaysOfTheWeek { get => this._daysOfTheWeek; set => this._daysOfTheWeek = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] _weeksOfTheMonth; + + /// List of weeks of month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] WeeksOfTheMonth { get => this._weeksOfTheMonth; set => this._weeksOfTheMonth = value; } + + /// Creates an new instance. + public WeeklyRetentionFormat() + { + + } + } + /// Weekly retention format. + public partial interface IWeeklyRetentionFormat : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of days of the week. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of the week.", + SerializedName = @"daysOfTheWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] DaysOfTheWeek { get; set; } + /// List of weeks of month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of weeks of month.", + SerializedName = @"weeksOfTheMonth", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] WeeksOfTheMonth { get; set; } + + } + /// Weekly retention format. + internal partial interface IWeeklyRetentionFormatInternal + + { + /// List of days of the week. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] DaysOfTheWeek { get; set; } + /// List of weeks of month. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] WeeksOfTheMonth { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionFormat.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionFormat.json.cs new file mode 100644 index 000000000000..3306dd362369 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionFormat.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Weekly retention format. + public partial class WeeklyRetentionFormat + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new WeeklyRetentionFormat(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._daysOfTheWeek) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._daysOfTheWeek ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("daysOfTheWeek",__w); + } + if (null != this._weeksOfTheMonth) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._weeksOfTheMonth ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("weeksOfTheMonth",__r); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal WeeklyRetentionFormat(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_daysOfTheWeek = If( json?.PropertyT("daysOfTheWeek"), out var __jsonDaysOfTheWeek) ? If( __jsonDaysOfTheWeek as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek)""))) ))() : null : DaysOfTheWeek;} + {_weeksOfTheMonth = If( json?.PropertyT("weeksOfTheMonth"), out var __jsonWeeksOfTheMonth) ? If( __jsonWeeksOfTheMonth as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth) (__p is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __o ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth)(__o.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth)""))) ))() : null : WeeksOfTheMonth;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionSchedule.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionSchedule.cs new file mode 100644 index 000000000000..3ffac3deeae3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionSchedule.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Weekly retention schedule. + public partial class WeeklyRetentionSchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionSchedule, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] _daysOfTheWeek; + + /// List of days of week for weekly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] DaysOfTheWeek { get => this._daysOfTheWeek; set => this._daysOfTheWeek = value; } + + /// Internal Acessors for RetentionDuration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionScheduleInternal.RetentionDuration { get => (this._retentionDuration = this._retentionDuration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration()); set { {_retentionDuration = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration _retentionDuration; + + /// Retention duration of retention Policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration RetentionDuration { get => (this._retentionDuration = this._retentionDuration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration()); set => this._retentionDuration = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? RetentionDurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).Count = value ?? default(int); } + + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).DurationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).DurationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType)""); } + + /// Backing field for property. + private global::System.DateTime[] _retentionTime; + + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime[] RetentionTime { get => this._retentionTime; set => this._retentionTime = value; } + + /// Creates an new instance. + public WeeklyRetentionSchedule() + { + + } + } + /// Weekly retention schedule. + public partial interface IWeeklyRetentionSchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of days of week for weekly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of week for weekly retention policy.", + SerializedName = @"daysOfTheWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] DaysOfTheWeek { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? RetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type of retention policy.", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get; set; } + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention times of retention policy.", + SerializedName = @"retentionTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] RetentionTime { get; set; } + + } + /// Weekly retention schedule. + internal partial interface IWeeklyRetentionScheduleInternal + + { + /// List of days of week for weekly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] DaysOfTheWeek { get; set; } + /// Retention duration of retention Policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration RetentionDuration { get; set; } + /// + /// 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. + /// + int? RetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get; set; } + /// Retention times of retention policy. + global::System.DateTime[] RetentionTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionSchedule.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionSchedule.json.cs new file mode 100644 index 000000000000..0df26556aba9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklyRetentionSchedule.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Weekly retention schedule. + public partial class WeeklyRetentionSchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionSchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionSchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new WeeklyRetentionSchedule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._retentionDuration ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionDuration.ToJson(null,serializationMode) : null, "retentionDuration" ,container.Add ); + if (null != this._daysOfTheWeek) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._daysOfTheWeek ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("daysOfTheWeek",__w); + } + if (null != this._retentionTime) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._retentionTime ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__s.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) ,__r.Add); + } + container.Add("retentionTimes",__r); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal WeeklyRetentionSchedule(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_retentionDuration = If( json?.PropertyT("retentionDuration"), out var __jsonRetentionDuration) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration.FromJson(__jsonRetentionDuration) : RetentionDuration;} + {_daysOfTheWeek = If( json?.PropertyT("daysOfTheWeek"), out var __jsonDaysOfTheWeek) ? If( __jsonDaysOfTheWeek as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek)""))) ))() : null : DaysOfTheWeek;} + {_retentionTime = If( json?.PropertyT("retentionTimes"), out var __jsonRetentionTimes) ? If( __jsonRetentionTimes as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(global::System.DateTime) (__p is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __o ? global::System.DateTime.TryParse((string)__o, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __oValue) ? __oValue : default(global::System.DateTime) : default(global::System.DateTime))) ))() : null : RetentionTime;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklySchedule.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklySchedule.cs new file mode 100644 index 000000000000..5b9ad38977ee --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklySchedule.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class WeeklySchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklySchedule, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyScheduleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] _scheduleRunDay; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] ScheduleRunDay { get => this._scheduleRunDay; set => this._scheduleRunDay = value; } + + /// Backing field for property. + private global::System.DateTime[] _scheduleRunTime; + + /// List of times of day this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime[] ScheduleRunTime { get => this._scheduleRunTime; set => this._scheduleRunTime = value; } + + /// Creates an new instance. + public WeeklySchedule() + { + + } + } + public partial interface IWeeklySchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"scheduleRunDays", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] ScheduleRunDay { get; set; } + /// List of times of day this schedule has to be run. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of times of day this schedule has to be run.", + SerializedName = @"scheduleRunTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] ScheduleRunTime { get; set; } + + } + internal partial interface IWeeklyScheduleInternal + + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] ScheduleRunDay { get; set; } + /// List of times of day this schedule has to be run. + global::System.DateTime[] ScheduleRunTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklySchedule.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklySchedule.json.cs new file mode 100644 index 000000000000..0f784107f91c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WeeklySchedule.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class WeeklySchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklySchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklySchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new WeeklySchedule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._scheduleRunDay) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._scheduleRunDay ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("scheduleRunDays",__w); + } + if (null != this._scheduleRunTime) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._scheduleRunTime ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__s.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) ,__r.Add); + } + container.Add("scheduleRunTimes",__r); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal WeeklySchedule(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_scheduleRunDay = If( json?.PropertyT("scheduleRunDays"), out var __jsonScheduleRunDays) ? If( __jsonScheduleRunDays as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek)""))) ))() : null : ScheduleRunDay;} + {_scheduleRunTime = If( json?.PropertyT("scheduleRunTimes"), out var __jsonScheduleRunTimes) ? If( __jsonScheduleRunTimes as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(global::System.DateTime) (__p is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __o ? global::System.DateTime.TryParse((string)__o, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __oValue) ? __oValue : default(global::System.DateTime) : default(global::System.DateTime))) ))() : null : ScheduleRunTime;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadInquiryDetails.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadInquiryDetails.cs new file mode 100644 index 000000000000..19c3627eaaa5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadInquiryDetails.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Details of an inquired protectable item. + public partial class WorkloadInquiryDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetailsInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetailCode; } + + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetailMessage; } + + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string[] ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetailRecommendation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidation _inquiryValidation; + + /// Inquiry validation such as permissions and other backup validations. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidation InquiryValidation { get => (this._inquiryValidation = this._inquiryValidation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InquiryValidation()); set => this._inquiryValidation = value; } + + /// Error Additional Detail in case the status is non-success. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string InquiryValidationAdditionalDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).AdditionalDetail; } + + /// Status for the Inquiry Validation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string InquiryValidationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).Status = value ?? null; } + + /// Backing field for property. + private long? _itemCount; + + /// Contains the protectable item Count inside this Container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? ItemCount { get => this._itemCount; set => this._itemCount = value; } + + /// Internal Acessors for ErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetailsInternal.ErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetailCode = value; } + + /// Internal Acessors for ErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetailsInternal.ErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetailMessage = value; } + + /// Internal Acessors for ErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetailsInternal.ErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetailRecommendation = value; } + + /// Internal Acessors for InquiryValidation + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidation Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetailsInternal.InquiryValidation { get => (this._inquiryValidation = this._inquiryValidation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InquiryValidation()); set { {_inquiryValidation = value;} } } + + /// Internal Acessors for InquiryValidationAdditionalDetail + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetailsInternal.InquiryValidationAdditionalDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).AdditionalDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).AdditionalDetail = value; } + + /// Internal Acessors for InquiryValidationErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetailsInternal.InquiryValidationErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidationInternal)InquiryValidation).ErrorDetail = value; } + + /// Backing field for property. + private string _type; + + /// Type of the Workload such as SQL, Oracle etc. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public WorkloadInquiryDetails() + { + + } + } + /// Details of an inquired protectable item. + public partial interface IWorkloadInquiryDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailCode { get; } + /// Error Message related to the Code. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message related to the Code.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailMessage { get; } + /// List of recommendation strings. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of recommendation strings.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] ErrorDetailRecommendation { get; } + /// Error Additional Detail in case the status is non-success. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Additional Detail in case the status is non-success.", + SerializedName = @"additionalDetail", + PossibleTypes = new [] { typeof(string) })] + string InquiryValidationAdditionalDetail { get; } + /// Status for the Inquiry Validation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status for the Inquiry Validation.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string InquiryValidationStatus { get; set; } + /// Contains the protectable item Count inside this Container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Contains the protectable item Count inside this Container.", + SerializedName = @"itemCount", + PossibleTypes = new [] { typeof(long) })] + long? ItemCount { get; set; } + /// Type of the Workload such as SQL, Oracle etc. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the Workload such as SQL, Oracle etc.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// Details of an inquired protectable item. + internal partial interface IWorkloadInquiryDetailsInternal + + { + /// Error code. + string ErrorDetailCode { get; set; } + /// Error Message related to the Code. + string ErrorDetailMessage { get; set; } + /// List of recommendation strings. + string[] ErrorDetailRecommendation { get; set; } + /// Inquiry validation such as permissions and other backup validations. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IInquiryValidation InquiryValidation { get; set; } + /// Error Additional Detail in case the status is non-success. + string InquiryValidationAdditionalDetail { get; set; } + /// Error Detail in case the status is non-success. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IErrorDetail InquiryValidationErrorDetail { get; set; } + /// Status for the Inquiry Validation. + string InquiryValidationStatus { get; set; } + /// Contains the protectable item Count inside this Container. + long? ItemCount { get; set; } + /// Type of the Workload such as SQL, Oracle etc. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadInquiryDetails.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadInquiryDetails.json.cs new file mode 100644 index 000000000000..4da192eb03c2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadInquiryDetails.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Details of an inquired protectable item. + public partial class WorkloadInquiryDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadInquiryDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new WorkloadInquiryDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._inquiryValidation ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._inquiryValidation.ToJson(null,serializationMode) : null, "inquiryValidation" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != this._itemCount ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._itemCount) : null, "itemCount" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal WorkloadInquiryDetails(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_inquiryValidation = If( json?.PropertyT("inquiryValidation"), out var __jsonInquiryValidation) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.InquiryValidation.FromJson(__jsonInquiryValidation) : InquiryValidation;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_itemCount = If( json?.PropertyT("itemCount"), out var __jsonItemCount) ? (long?)__jsonItemCount : ItemCount;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItem.cs new file mode 100644 index 000000000000..593e7b723ea6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup item. Workload-specific backup items are derived from this class. + /// + public partial class WorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal + { + + /// Backing field for property. + private string _backupManagementType; + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? _protectionState; + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => this._protectionState; set => this._protectionState = value; } + + /// Backing field for property. + private string _type; + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private string _workloadType; + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public WorkloadItem() + { + + } + } + /// Base class for backup item. Workload-specific backup items are derived from this class. + public partial interface IWorkloadItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management to backup an item.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(string) })] + string BackupManagementType { get; set; } + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the backup item.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"State of the back up item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the backup item.", + SerializedName = @"workloadItemType", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of workload for the backup management", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(string) })] + string WorkloadType { get; set; } + + } + /// Base class for backup item. Workload-specific backup items are derived from this class. + internal partial interface IWorkloadItemInternal + + { + /// Type of backup management to backup an item. + string BackupManagementType { get; set; } + /// Friendly name of the backup item. + string FriendlyName { get; set; } + /// State of the back up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// Type of the backup item. + string Type { get; set; } + /// Type of workload for the backup management + string WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItem.json.cs new file mode 100644 index 000000000000..fffca65c5a20 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup item. Workload-specific backup items are derived from this class. + /// + public partial class WorkloadItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("workloadItemType") ) + { + case "AzureVmWorkloadItem": + { + return new AzureVMWorkloadItem(json); + } + case "SAPAseDatabase": + { + return new AzureVMWorkloadSapAseDatabaseWorkloadItem(json); + } + case "SAPAseSystem": + { + return new AzureVMWorkloadSapAseSystemWorkloadItem(json); + } + case "SAPHanaDatabase": + { + return new AzureVMWorkloadSapHanaDatabaseWorkloadItem(json); + } + case "SAPHanaSystem": + { + return new AzureVMWorkloadSapHanaSystemWorkloadItem(json); + } + case "SQLDataBase": + { + return new AzureVMWorkloadSqlDatabaseWorkloadItem(json); + } + case "SQLInstance": + { + return new AzureVMWorkloadSqlInstanceWorkloadItem(json); + } + } + return new WorkloadItem(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._type.ToString()) : null, "workloadItemType" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._protectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionState.ToString()) : null, "protectionState" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal WorkloadItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + {_type = If( json?.PropertyT("workloadItemType"), out var __jsonWorkloadItemType) ? (string)__jsonWorkloadItemType : (string)Type;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_protectionState = If( json?.PropertyT("protectionState"), out var __jsonProtectionState) ? (string)__jsonProtectionState : (string)ProtectionState;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResource.cs new file mode 100644 index 000000000000..b261f15b3ac6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResource.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup item. Workload-specific backup items are derived from this class. + /// + public partial class WorkloadItemResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)Property).BackupManagementType = value ?? null; } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)Property).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)Property).FriendlyName = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadItem()); set { {_property = value;} } } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem _property; + + /// WorkloadItemResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadItem()); set => this._property = value; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)Property).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)Property).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string WorkloadItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)Property).Type = value ?? null; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)Property).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemInternal)Property).WorkloadType = value ?? null; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + + /// Creates an new instance. + public WorkloadItemResource() + { + + } + } + /// Base class for backup item. Workload-specific backup items are derived from this class. + public partial interface IWorkloadItemResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management to backup an item.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(string) })] + string BackupManagementType { get; set; } + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the backup item.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"State of the back up item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the backup item.", + SerializedName = @"workloadItemType", + PossibleTypes = new [] { typeof(string) })] + string WorkloadItemType { get; set; } + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of workload for the backup management", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(string) })] + string WorkloadType { get; set; } + + } + /// Base class for backup item. Workload-specific backup items are derived from this class. + internal partial interface IWorkloadItemResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Type of backup management to backup an item. + string BackupManagementType { get; set; } + /// Friendly name of the backup item. + string FriendlyName { get; set; } + /// WorkloadItemResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItem Property { get; set; } + /// State of the back up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// Type of the backup item. + string WorkloadItemType { get; set; } + /// Type of workload for the backup management + string WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResource.json.cs new file mode 100644 index 000000000000..7c1a76ff08be --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup item. Workload-specific backup items are derived from this class. + /// + public partial class WorkloadItemResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new WorkloadItemResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal WorkloadItemResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadItem.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResourceList.cs new file mode 100644 index 000000000000..65567dcbfe76 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of WorkloadItem resources + public partial class WorkloadItemResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResource[] Value { get => this._value; set => this._value = value; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + + /// Creates an new instance. + public WorkloadItemResourceList() + { + + } + } + /// List of WorkloadItem resources + public partial interface IWorkloadItemResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResource[] Value { get; set; } + + } + /// List of WorkloadItem resources + internal partial interface IWorkloadItemResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResourceList.json.cs new file mode 100644 index 000000000000..21fa7dfd4161 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadItemResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of WorkloadItem resources + public partial class WorkloadItemResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new WorkloadItemResourceList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal WorkloadItemResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadItemResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadItemResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItem.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItem.cs new file mode 100644 index 000000000000..4dfc32261da0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItem.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup item. Workload-specific backup items are derived from this class. + /// + public partial class WorkloadProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal + { + + /// Backing field for property. + private string _backupManagementType; + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupManagementType { get => this._backupManagementType; set => this._backupManagementType = value; } + + /// Backing field for property. + private string _friendlyName; + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Backing field for property. + private string _protectableItemType; + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectableItemType { get => this._protectableItemType; set => this._protectableItemType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? _protectionState; + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => this._protectionState; set => this._protectionState = value; } + + /// Backing field for property. + private string _workloadType; + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string WorkloadType { get => this._workloadType; set => this._workloadType = value; } + + /// Creates an new instance. + public WorkloadProtectableItem() + { + + } + } + /// Base class for backup item. Workload-specific backup items are derived from this class. + public partial interface IWorkloadProtectableItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management to backup an item.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(string) })] + string BackupManagementType { get; set; } + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the backup item.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the backup item.", + SerializedName = @"protectableItemType", + PossibleTypes = new [] { typeof(string) })] + string ProtectableItemType { get; set; } + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"State of the back up item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of workload for the backup management", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(string) })] + string WorkloadType { get; set; } + + } + /// Base class for backup item. Workload-specific backup items are derived from this class. + internal partial interface IWorkloadProtectableItemInternal + + { + /// Type of backup management to backup an item. + string BackupManagementType { get; set; } + /// Friendly name of the backup item. + string FriendlyName { get; set; } + /// Type of the backup item. + string ProtectableItemType { get; set; } + /// State of the back up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// Type of workload for the backup management + string WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItem.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItem.json.cs new file mode 100644 index 000000000000..2a49572d8d15 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItem.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup item. Workload-specific backup items are derived from this class. + /// + public partial class WorkloadProtectableItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("protectableItemType") ) + { + case "AzureFileShare": + { + return new AzureFileShareProtectableItem(json); + } + case "IaaSVMProtectableItem": + { + return new IaaSvmProtectableItem(json); + } + case "Microsoft.ClassicCompute/virtualMachines": + { + return new AzureIaaSClassicComputeVmprotectableItem(json); + } + case "Microsoft.Compute/virtualMachines": + { + return new AzureIaaSComputeVmprotectableItem(json); + } + case "AzureVmWorkloadProtectableItem": + { + return new AzureVMWorkloadProtectableItem(json); + } + case "SAPAseSystem": + { + return new AzureVMWorkloadSapAseSystemProtectableItem(json); + } + case "SAPHanaDatabase": + { + return new AzureVMWorkloadSapHanaDatabaseProtectableItem(json); + } + case "SAPHanaSystem": + { + return new AzureVMWorkloadSapHanaSystemProtectableItem(json); + } + case "SQLAvailabilityGroupContainer": + { + return new AzureVMWorkloadSqlAvailabilityGroupProtectableItem(json); + } + case "SQLDataBase": + { + return new AzureVMWorkloadSqlDatabaseProtectableItem(json); + } + case "SQLInstance": + { + return new AzureVMWorkloadSqlInstanceProtectableItem(json); + } + } + return new WorkloadProtectableItem(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._backupManagementType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupManagementType.ToString()) : null, "backupManagementType" ,container.Add ); + AddIf( null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType" ,container.Add ); + AddIf( null != (((object)this._protectableItemType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectableItemType.ToString()) : null, "protectableItemType" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._protectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionState.ToString()) : null, "protectionState" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal WorkloadProtectableItem(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_workloadType = If( json?.PropertyT("workloadType"), out var __jsonWorkloadType) ? (string)__jsonWorkloadType : (string)WorkloadType;} + {_protectableItemType = If( json?.PropertyT("protectableItemType"), out var __jsonProtectableItemType) ? (string)__jsonProtectableItemType : (string)ProtectableItemType;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_protectionState = If( json?.PropertyT("protectionState"), out var __jsonProtectionState) ? (string)__jsonProtectionState : (string)ProtectionState;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResource.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResource.cs new file mode 100644 index 000000000000..51efec032425 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResource.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup item. Workload-specific backup items are derived from this class. + /// + public partial class WorkloadProtectableItemResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(); + + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)Property).BackupManagementType = value ?? null; } + + /// Optional ETag. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).ETag = value ?? null; } + + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)Property).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)Property).FriendlyName = value ?? null; } + + /// Resource Id represents the complete path to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItem()); set { {_property = value;} } } + + /// Resource name associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem _property; + + /// WorkloadProtectableItemResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItem()); set => this._property = value; } + + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ProtectableItemType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)Property).ProtectableItemType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)Property).ProtectableItemType = value ?? null; } + + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)Property).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)Property).ProtectionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// + /// Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal)__resource).Type; } + + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string WorkloadType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)Property).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemInternal)Property).WorkloadType = value ?? null; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + + /// Creates an new instance. + public WorkloadProtectableItemResource() + { + + } + } + /// Base class for backup item. Workload-specific backup items are derived from this class. + public partial interface IWorkloadProtectableItemResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResource + { + /// Type of backup management to backup an item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of backup management to backup an item.", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(string) })] + string BackupManagementType { get; set; } + /// Friendly name of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the backup item.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Type of the backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the backup item.", + SerializedName = @"protectableItemType", + PossibleTypes = new [] { typeof(string) })] + string ProtectableItemType { get; set; } + /// State of the back up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"State of the back up item.", + SerializedName = @"protectionState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// Type of workload for the backup management + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of workload for the backup management", + SerializedName = @"workloadType", + PossibleTypes = new [] { typeof(string) })] + string WorkloadType { get; set; } + + } + /// Base class for backup item. Workload-specific backup items are derived from this class. + internal partial interface IWorkloadProtectableItemResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceInternal + { + /// Type of backup management to backup an item. + string BackupManagementType { get; set; } + /// Friendly name of the backup item. + string FriendlyName { get; set; } + /// WorkloadProtectableItemResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItem Property { get; set; } + /// Type of the backup item. + string ProtectableItemType { get; set; } + /// State of the back up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus? ProtectionState { get; set; } + /// Type of workload for the backup management + string WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResource.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResource.json.cs new file mode 100644 index 000000000000..b4e0017d9246 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResource.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Base class for backup item. Workload-specific backup items are derived from this class. + /// + public partial class WorkloadProtectableItemResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new WorkloadProtectableItemResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal WorkloadProtectableItemResource(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItem.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResourceList.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResourceList.cs new file mode 100644 index 000000000000..a868241f1d30 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResourceList.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of WorkloadProtectableItem resources + public partial class WorkloadProtectableItemResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(); + + /// + /// The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResource[] _value; + + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResource[] Value { get => this._value; set => this._value = value; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resourceList), __resourceList); + await eventListener.AssertObjectIsValid(nameof(__resourceList), __resourceList); + } + + /// Creates an new instance. + public WorkloadProtectableItemResourceList() + { + + } + } + /// List of WorkloadProtectableItem resources + public partial interface IWorkloadProtectableItemResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceList + { + /// List of resources. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResource[] Value { get; set; } + + } + /// List of WorkloadProtectableItem resources + internal partial interface IWorkloadProtectableItemResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResourceList.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResourceList.json.cs new file mode 100644 index 000000000000..3f3ae0229258 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/WorkloadProtectableItemResourceList.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of WorkloadProtectableItem resources + public partial class WorkloadProtectableItemResourceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new WorkloadProtectableItemResourceList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resourceList?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal WorkloadProtectableItemResourceList(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceList(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWorkloadProtectableItemResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItemResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/YearlyRetentionSchedule.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/YearlyRetentionSchedule.cs new file mode 100644 index 000000000000..b73f0aa627d3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/YearlyRetentionSchedule.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Yearly retention schedule. + public partial class YearlyRetentionSchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionSchedule, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal + { + + /// Internal Acessors for RetentionDuration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal.RetentionDuration { get => (this._retentionDuration = this._retentionDuration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration()); set { {_retentionDuration = value;} } } + + /// Internal Acessors for RetentionScheduleDaily + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal.RetentionScheduleDaily { get => (this._retentionScheduleDaily = this._retentionScheduleDaily ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailyRetentionFormat()); set { {_retentionScheduleDaily = value;} } } + + /// Internal Acessors for RetentionScheduleWeekly + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionScheduleInternal.RetentionScheduleWeekly { get => (this._retentionScheduleWeekly = this._retentionScheduleWeekly ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklyRetentionFormat()); set { {_retentionScheduleWeekly = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear[] _monthsOfYear; + + /// List of months of year of yearly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear[] MonthsOfYear { get => this._monthsOfYear; set => this._monthsOfYear = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration _retentionDuration; + + /// Retention duration of retention Policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration RetentionDuration { get => (this._retentionDuration = this._retentionDuration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration()); set => this._retentionDuration = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public int? RetentionDurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).Count = value ?? default(int); } + + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).DurationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDurationInternal)RetentionDuration).DurationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat _retentionScheduleDaily; + + /// Daily retention format for yearly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat RetentionScheduleDaily { get => (this._retentionScheduleDaily = this._retentionScheduleDaily ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailyRetentionFormat()); set => this._retentionScheduleDaily = value; } + + /// List of days of the month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] RetentionScheduleDailyDaysOfTheMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormatInternal)RetentionScheduleDaily).DaysOfTheMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormatInternal)RetentionScheduleDaily).DaysOfTheMonth = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? _retentionScheduleFormatType; + + /// Retention schedule format for yearly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? RetentionScheduleFormatType { get => this._retentionScheduleFormatType; set => this._retentionScheduleFormatType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat _retentionScheduleWeekly; + + /// Weekly retention format for yearly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat RetentionScheduleWeekly { get => (this._retentionScheduleWeekly = this._retentionScheduleWeekly ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklyRetentionFormat()); set => this._retentionScheduleWeekly = value; } + + /// List of days of the week. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] RetentionScheduleWeeklyDaysOfTheWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormatInternal)RetentionScheduleWeekly).DaysOfTheWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormatInternal)RetentionScheduleWeekly).DaysOfTheWeek = value ?? null /* arrayOf */; } + + /// List of weeks of month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] RetentionScheduleWeeklyWeeksOfTheMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormatInternal)RetentionScheduleWeekly).WeeksOfTheMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormatInternal)RetentionScheduleWeekly).WeeksOfTheMonth = value ?? null /* arrayOf */; } + + /// Backing field for property. + private global::System.DateTime[] _retentionTime; + + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public global::System.DateTime[] RetentionTime { get => this._retentionTime; set => this._retentionTime = value; } + + /// Creates an new instance. + public YearlyRetentionSchedule() + { + + } + } + /// Yearly retention schedule. + public partial interface IYearlyRetentionSchedule : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// List of months of year of yearly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of months of year of yearly retention policy.", + SerializedName = @"monthsOfYear", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear[] MonthsOfYear { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? RetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention duration type of retention policy.", + SerializedName = @"durationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get; set; } + /// List of days of the month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of the month.", + SerializedName = @"daysOfTheMonth", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] RetentionScheduleDailyDaysOfTheMonth { get; set; } + /// Retention schedule format for yearly retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention schedule format for yearly retention policy.", + SerializedName = @"retentionScheduleFormatType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? RetentionScheduleFormatType { get; set; } + /// List of days of the week. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of days of the week.", + SerializedName = @"daysOfTheWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] RetentionScheduleWeeklyDaysOfTheWeek { get; set; } + /// List of weeks of month. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of weeks of month.", + SerializedName = @"weeksOfTheMonth", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] RetentionScheduleWeeklyWeeksOfTheMonth { get; set; } + /// Retention times of retention policy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention times of retention policy.", + SerializedName = @"retentionTimes", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime[] RetentionTime { get; set; } + + } + /// Yearly retention schedule. + internal partial interface IYearlyRetentionScheduleInternal + + { + /// List of months of year of yearly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear[] MonthsOfYear { get; set; } + /// Retention duration of retention Policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRetentionDuration RetentionDuration { get; set; } + /// + /// 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. + /// + int? RetentionDurationCount { get; set; } + /// Retention duration type of retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType? RetentionDurationType { get; set; } + /// Daily retention format for yearly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDailyRetentionFormat RetentionScheduleDaily { get; set; } + /// List of days of the month. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IDay[] RetentionScheduleDailyDaysOfTheMonth { get; set; } + /// Retention schedule format for yearly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat? RetentionScheduleFormatType { get; set; } + /// Weekly retention format for yearly retention policy. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IWeeklyRetentionFormat RetentionScheduleWeekly { get; set; } + /// List of days of the week. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek[] RetentionScheduleWeeklyDaysOfTheWeek { get; set; } + /// List of weeks of month. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth[] RetentionScheduleWeeklyWeeksOfTheMonth { get; set; } + /// Retention times of retention policy. + global::System.DateTime[] RetentionTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/YearlyRetentionSchedule.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/YearlyRetentionSchedule.json.cs new file mode 100644 index 000000000000..6a419ecb719e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/Api20211201/YearlyRetentionSchedule.json.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.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Yearly retention schedule. + public partial class YearlyRetentionSchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionSchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionSchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IYearlyRetentionSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new YearlyRetentionSchedule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._retentionScheduleDaily ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionScheduleDaily.ToJson(null,serializationMode) : null, "retentionScheduleDaily" ,container.Add ); + AddIf( null != this._retentionScheduleWeekly ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionScheduleWeekly.ToJson(null,serializationMode) : null, "retentionScheduleWeekly" ,container.Add ); + AddIf( null != this._retentionDuration ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._retentionDuration.ToJson(null,serializationMode) : null, "retentionDuration" ,container.Add ); + AddIf( null != (((object)this._retentionScheduleFormatType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._retentionScheduleFormatType.ToString()) : null, "retentionScheduleFormatType" ,container.Add ); + if (null != this._monthsOfYear) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __x in this._monthsOfYear ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("monthsOfYear",__w); + } + if (null != this._retentionTime) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.XNodeArray(); + foreach( var __s in this._retentionTime ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(__s.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) ,__r.Add); + } + container.Add("retentionTimes",__r); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal YearlyRetentionSchedule(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_retentionScheduleDaily = If( json?.PropertyT("retentionScheduleDaily"), out var __jsonRetentionScheduleDaily) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.DailyRetentionFormat.FromJson(__jsonRetentionScheduleDaily) : RetentionScheduleDaily;} + {_retentionScheduleWeekly = If( json?.PropertyT("retentionScheduleWeekly"), out var __jsonRetentionScheduleWeekly) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WeeklyRetentionFormat.FromJson(__jsonRetentionScheduleWeekly) : RetentionScheduleWeekly;} + {_retentionDuration = If( json?.PropertyT("retentionDuration"), out var __jsonRetentionDuration) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RetentionDuration.FromJson(__jsonRetentionDuration) : RetentionDuration;} + {_retentionScheduleFormatType = If( json?.PropertyT("retentionScheduleFormatType"), out var __jsonRetentionScheduleFormatType) ? (string)__jsonRetentionScheduleFormatType : (string)RetentionScheduleFormatType;} + {_monthsOfYear = If( json?.PropertyT("monthsOfYear"), out var __jsonMonthsOfYear) ? If( __jsonMonthsOfYear as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear) (__u is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear)""))) ))() : null : MonthsOfYear;} + {_retentionTime = If( json?.PropertyT("retentionTimes"), out var __jsonRetentionTimes) ? If( __jsonRetentionTimes as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(global::System.DateTime) (__p is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString __o ? global::System.DateTime.TryParse((string)__o, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __oValue) ? __oValue : default(global::System.DateTime) : default(global::System.DateTime))) ))() : null : RetentionTime;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/RecoveryServicesBackupIdentity.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/RecoveryServicesBackupIdentity.cs new file mode 100644 index 000000000000..6487ae14a778 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/RecoveryServicesBackupIdentity.cs @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class RecoveryServicesBackupIdentity : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal + { + + /// Backing field for property. + private string _azureRegion; + + /// Azure region to hit Api + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AzureRegion { get => this._azureRegion; set => this._azureRegion = value; } + + /// Backing field for property. + private string _backupEngineName; + + /// Name of the backup management server. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BackupEngineName { get => this._backupEngineName; set => this._backupEngineName = value; } + + /// Backing field for property. + private string _containerName; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private string _fabricName; + + /// Fabric name associated with the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// Backing field for property. + private string _id; + + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _intentObjectName; + + /// Backed up item name whose details are to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string IntentObjectName { get => this._intentObjectName; set => this._intentObjectName = value; } + + /// Backing field for property. + private string _jobName; + + /// Name of the job whose details are to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string JobName { get => this._jobName; set => this._jobName = value; } + + /// Backing field for property. + private string _operationId; + + /// Operation id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// Backing field for property. + private string _policyName; + + /// Backup policy information to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PolicyName { get => this._policyName; set => this._policyName = value; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// The name of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = value; } + + /// Backing field for property. + private string _protectedItemName; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectedItemName { get => this._protectedItemName; set => this._protectedItemName = value; } + + /// Backing field for property. + private string _recoveryPointId; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryPointId { get => this._recoveryPointId; set => this._recoveryPointId = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group where the recovery services vault is present. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceGuardProxyName; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceGuardProxyName { get => this._resourceGuardProxyName; set => this._resourceGuardProxyName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription Id. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _vaultName; + + /// The name of the recovery services vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string VaultName { get => this._vaultName; set => this._vaultName = value; } + + /// Creates an new instance. + public RecoveryServicesBackupIdentity() + { + + } + } + public partial interface IRecoveryServicesBackupIdentity : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Azure region to hit Api + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure region to hit Api", + SerializedName = @"azureRegion", + PossibleTypes = new [] { typeof(string) })] + string AzureRegion { get; set; } + /// Name of the backup management server. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the backup management server.", + SerializedName = @"backupEngineName", + PossibleTypes = new [] { typeof(string) })] + string BackupEngineName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Fabric name associated with the backed up item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fabric name associated with the backed up item.", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + string FabricName { get; set; } + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identity path", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Backed up item name whose details are to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backed up item name whose details are to be fetched.", + SerializedName = @"intentObjectName", + PossibleTypes = new [] { typeof(string) })] + string IntentObjectName { get; set; } + /// Name of the job whose details are to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the job whose details are to be fetched.", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + string JobName { get; set; } + /// Operation id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation id", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + /// Backup policy information to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup policy information to be fetched.", + SerializedName = @"policyName", + PossibleTypes = new [] { typeof(string) })] + string PolicyName { get; set; } + /// The name of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the private endpoint connection.", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointConnectionName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"protectedItemName", + PossibleTypes = new [] { typeof(string) })] + string ProtectedItemName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"recoveryPointId", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointId { get; set; } + /// The name of the resource group where the recovery services vault is present. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the resource group where the recovery services vault is present.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"resourceGuardProxyName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGuardProxyName { get; set; } + /// The subscription Id. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// The name of the recovery services vault. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the recovery services vault.", + SerializedName = @"vaultName", + PossibleTypes = new [] { typeof(string) })] + string VaultName { get; set; } + + } + internal partial interface IRecoveryServicesBackupIdentityInternal + + { + /// Azure region to hit Api + string AzureRegion { get; set; } + /// Name of the backup management server. + string BackupEngineName { get; set; } + + string ContainerName { get; set; } + /// Fabric name associated with the backed up item. + string FabricName { get; set; } + /// Resource identity path + string Id { get; set; } + /// Backed up item name whose details are to be fetched. + string IntentObjectName { get; set; } + /// Name of the job whose details are to be fetched. + string JobName { get; set; } + /// Operation id + string OperationId { get; set; } + /// Backup policy information to be fetched. + string PolicyName { get; set; } + /// The name of the private endpoint connection. + string PrivateEndpointConnectionName { get; set; } + + string ProtectedItemName { get; set; } + + string RecoveryPointId { get; set; } + /// The name of the resource group where the recovery services vault is present. + string ResourceGroupName { get; set; } + + string ResourceGuardProxyName { get; set; } + /// The subscription Id. + string SubscriptionId { get; set; } + /// The name of the recovery services vault. + string VaultName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Models/RecoveryServicesBackupIdentity.json.cs b/swaggerci/recoveryservicesbackup/generated/api/Models/RecoveryServicesBackupIdentity.json.cs new file mode 100644 index 000000000000..2e7396c0783a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Models/RecoveryServicesBackupIdentity.json.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class RecoveryServicesBackupIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RecoveryServicesBackupIdentity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject instance to deserialize from. + internal RecoveryServicesBackupIdentity(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_vaultName = If( json?.PropertyT("vaultName"), out var __jsonVaultName) ? (string)__jsonVaultName : (string)VaultName;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_azureRegion = If( json?.PropertyT("azureRegion"), out var __jsonAzureRegion) ? (string)__jsonAzureRegion : (string)AzureRegion;} + {_fabricName = If( json?.PropertyT("fabricName"), out var __jsonFabricName) ? (string)__jsonFabricName : (string)FabricName;} + {_intentObjectName = If( json?.PropertyT("intentObjectName"), out var __jsonIntentObjectName) ? (string)__jsonIntentObjectName : (string)IntentObjectName;} + {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)PrivateEndpointConnectionName;} + {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_protectedItemName = If( json?.PropertyT("protectedItemName"), out var __jsonProtectedItemName) ? (string)__jsonProtectedItemName : (string)ProtectedItemName;} + {_recoveryPointId = If( json?.PropertyT("recoveryPointId"), out var __jsonRecoveryPointId) ? (string)__jsonRecoveryPointId : (string)RecoveryPointId;} + {_policyName = If( json?.PropertyT("policyName"), out var __jsonPolicyName) ? (string)__jsonPolicyName : (string)PolicyName;} + {_jobName = If( json?.PropertyT("jobName"), out var __jsonJobName) ? (string)__jsonJobName : (string)JobName;} + {_backupEngineName = If( json?.PropertyT("backupEngineName"), out var __jsonBackupEngineName) ? (string)__jsonBackupEngineName : (string)BackupEngineName;} + {_resourceGuardProxyName = If( json?.PropertyT("resourceGuardProxyName"), out var __jsonResourceGuardProxyName) ? (string)__jsonResourceGuardProxyName : (string)ResourceGuardProxyName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._vaultName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._vaultName.ToString()) : null, "vaultName" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._azureRegion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._azureRegion.ToString()) : null, "azureRegion" ,container.Add ); + AddIf( null != (((object)this._fabricName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._fabricName.ToString()) : null, "fabricName" ,container.Add ); + AddIf( null != (((object)this._intentObjectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._intentObjectName.ToString()) : null, "intentObjectName" ,container.Add ); + AddIf( null != (((object)this._privateEndpointConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._privateEndpointConnectionName.ToString()) : null, "privateEndpointConnectionName" ,container.Add ); + AddIf( null != (((object)this._operationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._operationId.ToString()) : null, "operationId" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._protectedItemName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectedItemName.ToString()) : null, "protectedItemName" ,container.Add ); + AddIf( null != (((object)this._recoveryPointId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointId.ToString()) : null, "recoveryPointId" ,container.Add ); + AddIf( null != (((object)this._policyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._policyName.ToString()) : null, "policyName" ,container.Add ); + AddIf( null != (((object)this._jobName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._jobName.ToString()) : null, "jobName" ,container.Add ); + AddIf( null != (((object)this._backupEngineName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._backupEngineName.ToString()) : null, "backupEngineName" ,container.Add ); + AddIf( null != (((object)this._resourceGuardProxyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceGuardProxyName.ToString()) : null, "resourceGuardProxyName" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/RecoveryServicesBackupClient.cs b/swaggerci/recoveryservicesbackup/generated/api/RecoveryServicesBackupClient.cs new file mode 100644 index 000000000000..919857afb608 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/RecoveryServicesBackupClient.cs @@ -0,0 +1,15076 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// + /// Low-level API implementation for the Recovery Services Backup Client service. + /// Open API 2.0 Specs for Azure RecoveryServices Backup service + /// + public partial class RecoveryServicesBackupClient + { + + /// 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. + /// The subscription Id. + /// Name of the backup management server. + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupEnginesGet(string vaultName, string resourceGroupName, string subscriptionId, string backupEngineName, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupEngines/" + + global::System.Uri.EscapeDataString(backupEngineName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupEnginesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns backup management server registered to Recovery Services Vault. + /// + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupEnginesGetViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupEngines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var backupEngineName = _match.Groups["backupEngineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupEngines/" + + backupEngineName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupEnginesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupEnginesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineBaseResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Name of the backup management server. + /// OData filter options. + /// skipToken Filter. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupEnginesGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string backupEngineName, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(backupEngineName),backupEngineName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(SkipToken),SkipToken); + } + } + + /// + /// 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. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupEnginesList(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupEngines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupEnginesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + /// + /// + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupEnginesListViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupEngines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupEngines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupEnginesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupEnginesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupEngineBaseResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupEnginesList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(SkipToken),SkipToken); + } + } + + /// 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. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupJobsList(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupJobs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupJobsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Provides a pageable list of jobs. + /// + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupJobsListViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupJobs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupJobs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupJobsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupJobsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.JobResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupJobsList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(SkipToken),SkipToken); + } + } + + /// + /// 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. + /// The subscription Id. + /// OperationID which represents the operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupOperationResultsGet(string vaultName, string resourceGroupName, string subscriptionId, string operationId, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupOperationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupOperationResultsGet_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupOperationResultsGetViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupOperationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupOperationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupOperationResultsGet_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupOperationResultsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OperationID which represents the operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupOperationResultsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// OperationID which represents the operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupOperationStatusesGet(string vaultName, string resourceGroupName, string subscriptionId, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupOperations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupOperationStatusesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupOperationStatusesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupOperations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupOperations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupOperationStatusesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupOperationStatusesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OperationID which represents the operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupOperationStatusesGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// OData filter options. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupPoliciesList(string vaultName, string resourceGroupName, string subscriptionId, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupPolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupPoliciesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + /// scoped results. + /// + /// + /// OData filter options. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupPoliciesListViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupPolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupPoliciesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupPoliciesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicyResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OData filter options. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupPoliciesList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// 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. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupProtectableItemsList(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupProtectableItems" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupProtectableItemsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Provides a pageable list of protectable objects within your subscription according to the query filter and the + /// pagination parameters. + /// + /// + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupProtectableItemsListViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupProtectableItems$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectableItems'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupProtectableItems" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupProtectableItemsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupProtectableItemsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadProtectableItemResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupProtectableItemsList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(SkipToken),SkipToken); + } + } + + /// 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. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupProtectedItemsList(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupProtectedItems" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupProtectedItemsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Provides a pageable list of all items that are backed up within a vault. + /// + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupProtectedItemsListViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupProtectedItems$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupProtectedItems" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupProtectedItemsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupProtectedItemsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItemResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupProtectedItemsList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(SkipToken),SkipToken); + } + } + + /// 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. + /// The subscription Id. + /// OData filter options. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupProtectionContainersList(string vaultName, string resourceGroupName, string subscriptionId, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupProtectionContainers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupProtectionContainersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the containers registered to Recovery Services Vault. + /// + /// OData filter options. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupProtectionContainersListViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupProtectionContainers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupProtectionContainers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupProtectionContainersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupProtectionContainersList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainerResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OData filter options. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupProtectionContainersList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// 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. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupProtectionIntentList(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupProtectionIntents" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupProtectionIntentList_Call(request,onOk,eventListener,sender); + } + } + + /// Provides a pageable list of all intents that are present within a vault. + /// + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupProtectionIntentListViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupProtectionIntents$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionIntents'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupProtectionIntents" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupProtectionIntentList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupProtectionIntentList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntentResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupProtectionIntentList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(SkipToken),SkipToken); + } + } + + /// 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 subscription Id. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceEncryptionConfigsGet(string vaultName, string resourceGroupName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupEncryptionConfigs/backupResourceEncryptionConfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceEncryptionConfigsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Fetches Vault Encryption config. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceEncryptionConfigsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupEncryptionConfigs/backupResourceEncryptionConfig$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupEncryptionConfigs/backupResourceEncryptionConfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceEncryptionConfigsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceEncryptionConfigsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceEncryptionConfigExtendedResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceEncryptionConfigsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Updates Vault encryption config. + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Vault encryption input config request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceEncryptionConfigsUpdate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigResource body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupEncryptionConfigs/backupResourceEncryptionConfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceEncryptionConfigsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates Vault encryption config. + /// + /// Vault encryption input config request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceEncryptionConfigsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigResource body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupEncryptionConfigs/backupResourceEncryptionConfig$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupEncryptionConfigs/backupResourceEncryptionConfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceEncryptionConfigsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceEncryptionConfigsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Vault encryption input config request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceEncryptionConfigsUpdate_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceEncryptionConfigResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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 subscription Id. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrGet(string vaultName, string resourceGroupName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupstorageconfig/vaultstorageconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceStorageConfigsNonCrrGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Fetches resource storage config. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupstorageconfig/vaultstorageconfig$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupstorageconfig/vaultstorageconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceStorageConfigsNonCrrGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceConfigResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// 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. + /// The subscription Id. + /// Vault storage config request + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrPatch(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResource body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupstorageconfig/vaultstorageconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceStorageConfigsNonCrrPatch_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Updates vault storage model type. + /// + /// Vault storage config request + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrPatchViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResource body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupstorageconfig/vaultstorageconfig$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupstorageconfig/vaultstorageconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceStorageConfigsNonCrrPatch_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrPatch_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Vault storage config request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrPatch_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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. + /// The subscription Id. + /// Vault storage config request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrUpdate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupstorageconfig/vaultstorageconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceStorageConfigsNonCrrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates vault storage model type. + /// + /// Vault storage config request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupstorageconfig/vaultstorageconfig$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupstorageconfig/vaultstorageconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceStorageConfigsNonCrrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceConfigResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Vault storage config request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceStorageConfigsNonCrrUpdate_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceConfigResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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 subscription Id. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceVaultConfigsGet(string vaultName, string resourceGroupName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupconfig/vaultconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceVaultConfigsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Fetches resource vault config. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceVaultConfigsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupconfig/vaultconfig$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupconfig/vaultconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceVaultConfigsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceVaultConfigsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceVaultConfigResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceVaultConfigsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Updates vault security config. + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// resource config request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceVaultConfigsPut(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupconfig/vaultconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceVaultConfigsPut_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates vault security config. + /// + /// resource config request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceVaultConfigsPutViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupconfig/vaultconfig$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupconfig/vaultconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceVaultConfigsPut_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceVaultConfigsPut_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceVaultConfigResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// resource config request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceVaultConfigsPut_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Updates vault security config. + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// resource config request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceVaultConfigsUpdate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupconfig/vaultconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceVaultConfigsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates vault security config. + /// + /// resource config request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupResourceVaultConfigsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupconfig/vaultconfig$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupconfig/vaultconfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupResourceVaultConfigsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceVaultConfigsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupResourceVaultConfigResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// resource config request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupResourceVaultConfigsUpdate_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupResourceVaultConfigResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get the container backup status + /// Azure region to hit Api + /// The subscription Id. + /// Container Backup Status Request + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupStatusGet(string azureRegion, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.RecoveryServices/locations/" + + global::System.Uri.EscapeDataString(azureRegion) + + "/backupStatus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupStatusGet_Call(request,onOk,eventListener,sender); + } + } + + /// Get the container backup status + /// + /// Container Backup Status Request + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupStatusGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/providers/Microsoft.RecoveryServices/locations/(?[^/]+)/backupStatus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus'"); + } + + // replace URI parameters with values from identity + var azureRegion = _match.Groups["azureRegion"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/providers/Microsoft.RecoveryServices/locations/" + + azureRegion + + "/backupStatus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupStatusGet_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupStatusGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupStatusResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Azure region to hit Api + /// The subscription Id. + /// Container Backup Status Request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupStatusGet_Validate(string azureRegion, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupStatusRequest body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(azureRegion),azureRegion); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupUsageSummariesList(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupUsageSummaries" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupUsageSummariesList_Call(request,onOk,eventListener,sender); + } + } + + /// Fetches the backup management usage summaries of the vault. + /// + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupUsageSummariesListViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupUsageSummaries$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupUsageSummaries" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupUsageSummariesList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupUsageSummariesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.BackupManagementUsageList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupUsageSummariesList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(SkipToken),SkipToken); + } + } + + /// + /// 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. + /// The subscription Id. + /// Fabric name associated with the container. + /// Name of the container. + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupWorkloadItemsList(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/items" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupWorkloadItemsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Provides a pageable list of workload item of a specific container according to the query filter and the pagination + /// parameters. + /// + /// + /// OData filter options. + /// skipToken Filter. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupWorkloadItemsListViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/items$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/items" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupWorkloadItemsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupWorkloadItemsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.WorkloadItemResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric name associated with the container. + /// Name of the container. + /// OData filter options. + /// skipToken Filter. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupWorkloadItemsList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(SkipToken),SkipToken); + } + } + + /// + /// 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. + /// The subscription Id. + /// 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 + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupsTrigger(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestResource body, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "/backup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupsTrigger_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// resource backup request + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupsTriggerViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestResource body, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)/backup$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "/backup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupsTrigger_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupsTrigger_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// 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 + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupsTrigger_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IBackupRequestResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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 subscription Id. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BmsPrepareDataMoveOperationResultGet(string vaultName, string resourceGroupName, string subscriptionId, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupstorageconfig/vaultstorageconfig/operationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BmsPrepareDataMoveOperationResultGet_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// Fetches Operation Result for Prepare Data Move + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BmsPrepareDataMoveOperationResultGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupstorageconfig/vaultstorageconfig/operationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupstorageconfig/vaultstorageconfig/operationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BmsPrepareDataMoveOperationResultGet_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BmsPrepareDataMoveOperationResultGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.VaultStorageConfigOperationResultResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BmsPrepareDataMoveOperationResultGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// 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. + /// The subscription Id. + /// Prepare data move request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BmsprepareDataMove(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveRequest body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupstorageconfig/vaultstorageconfig/prepareDataMove" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BmsprepareDataMove_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Prepares source vault for Data Move operation + /// + /// Prepare data move request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BmsprepareDataMoveViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveRequest body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupstorageconfig/vaultstorageconfig/prepareDataMove$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupstorageconfig/vaultstorageconfig/prepareDataMove" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BmsprepareDataMove_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BmsprepareDataMove_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Prepare data move request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BmsprepareDataMove_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrepareDataMoveRequest body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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. + /// The subscription Id. + /// Trigger data move request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BmstriggerDataMove(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITriggerDataMoveRequest body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupstorageconfig/vaultstorageconfig/triggerDataMove" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BmstriggerDataMove_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Triggers Data Move Operation on target vault + /// + /// Trigger data move request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BmstriggerDataMoveViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITriggerDataMoveRequest body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupstorageconfig/vaultstorageconfig/triggerDataMove$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupstorageconfig/vaultstorageconfig/triggerDataMove" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BmstriggerDataMove_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BmstriggerDataMove_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Trigger data move request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BmstriggerDataMove_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ITriggerDataMoveRequest body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// The subscription Id. + /// OperationID which represents the export job. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportJobsOperationResultsGet(string vaultName, string resourceGroupName, string subscriptionId, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupJobs/operationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportJobsOperationResultsGet_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportJobsOperationResultsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupJobs/operationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/operationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupJobs/operationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportJobsOperationResultsGet_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportJobsOperationResultsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationResultInfoBaseResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationResultInfoBaseResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OperationID which represents the export job. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportJobsOperationResultsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// It will validate if given feature with resource properties is supported in service + /// + /// Azure region to hit Api + /// The subscription Id. + /// Feature support request object + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FeatureSupportValidate(string azureRegion, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.RecoveryServices/locations/" + + global::System.Uri.EscapeDataString(azureRegion) + + "/backupValidateFeatures" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FeatureSupportValidate_Call(request,onOk,eventListener,sender); + } + } + + /// + /// It will validate if given feature with resource properties is supported in service + /// + /// + /// Feature support request object + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FeatureSupportValidateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/providers/Microsoft.RecoveryServices/locations/(?[^/]+)/backupValidateFeatures$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures'"); + } + + // replace URI parameters with values from identity + var azureRegion = _match.Groups["azureRegion"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/providers/Microsoft.RecoveryServices/locations/" + + azureRegion + + "/backupValidateFeatures" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FeatureSupportValidate_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FeatureSupportValidate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.AzureVMResourceFeatureSupportResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Azure region to hit Api + /// The subscription Id. + /// Feature support request object + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FeatureSupportValidate_Validate(string azureRegion, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IFeatureSupportRequest body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(azureRegion),azureRegion); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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 subscription Id. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GetOperationStatus(string vaultName, string resourceGroupName, string subscriptionId, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupstorageconfig/vaultstorageconfig/operationStatus/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GetOperationStatus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Fetches operation status for data move operation on vault + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GetOperationStatusViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupstorageconfig/vaultstorageconfig/operationStatus/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationStatus/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupstorageconfig/vaultstorageconfig/operationStatus/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GetOperationStatus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GetOperationStatus_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GetOperationStatus_Validate(string vaultName, string resourceGroupName, string subscriptionId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// 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 + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ItemLevelRecoveryConnectionsProvision(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestResource body, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "/recoveryPoints/" + + global::System.Uri.EscapeDataString(recoveryPointId) + + "/provisionInstantItemRecovery" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ItemLevelRecoveryConnectionsProvision_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// resource ILR request + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ItemLevelRecoveryConnectionsProvisionViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestResource body, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)/recoveryPoints/(?[^/]+)/provisionInstantItemRecovery$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + var recoveryPointId = _match.Groups["recoveryPointId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "/recoveryPoints/" + + recoveryPointId + + "/provisionInstantItemRecovery" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ItemLevelRecoveryConnectionsProvision_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ItemLevelRecoveryConnectionsProvision_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// 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 + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ItemLevelRecoveryConnectionsProvision_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IIlrRequestResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(recoveryPointId),recoveryPointId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// The subscription Id. + /// 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. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ItemLevelRecoveryConnectionsRevoke(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "/recoveryPoints/" + + global::System.Uri.EscapeDataString(recoveryPointId) + + "/revokeInstantItemRecovery" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ItemLevelRecoveryConnectionsRevoke_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ItemLevelRecoveryConnectionsRevokeViaIdentity(global::System.String viaIdentity, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)/recoveryPoints/(?[^/]+)/revokeInstantItemRecovery$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + var recoveryPointId = _match.Groups["recoveryPointId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "/recoveryPoints/" + + recoveryPointId + + "/revokeInstantItemRecovery" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ItemLevelRecoveryConnectionsRevoke_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ItemLevelRecoveryConnectionsRevoke_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ItemLevelRecoveryConnectionsRevoke_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(recoveryPointId),recoveryPointId); + } + } + + /// + /// 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. + /// The subscription Id. + /// Name of the job to cancel. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobCancellationsTrigger(string vaultName, string resourceGroupName, string subscriptionId, string jobName, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupJobs/" + + global::System.Uri.EscapeDataString(jobName) + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobCancellationsTrigger_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + /// GetCancelOperationResult API. + /// + /// + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobCancellationsTriggerViaIdentity(global::System.String viaIdentity, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupJobs/(?[^/]+)/cancel$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var jobName = _match.Groups["jobName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupJobs/" + + jobName + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobCancellationsTrigger_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobCancellationsTrigger_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Name of the job to cancel. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobCancellationsTrigger_Validate(string vaultName, string resourceGroupName, string subscriptionId, string jobName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(jobName),jobName); + } + } + + /// 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. + /// The subscription Id. + /// Name of the job whose details are to be fetched. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobDetailsGet(string vaultName, string resourceGroupName, string subscriptionId, string jobName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupJobs/" + + global::System.Uri.EscapeDataString(jobName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobDetailsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets extended information associated with the job. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobDetailsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupJobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var jobName = _match.Groups["jobName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupJobs/" + + jobName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobDetailsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobDetailsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.JobResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Name of the job whose details are to be fetched. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobDetailsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string jobName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(jobName),jobName); + } + } + + /// 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. + /// The subscription Id. + /// Job name whose operation result has to be fetched. + /// OperationID which represents the operation whose result has to be fetched. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobOperationResultsGet(string vaultName, string resourceGroupName, string subscriptionId, string jobName, string operationId, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupJobs/" + + global::System.Uri.EscapeDataString(jobName) + + "/operationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobOperationResultsGet_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// Fetches the result of any operation. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobOperationResultsGetViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupJobs/(?[^/]+)/operationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var jobName = _match.Groups["jobName"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupJobs/" + + jobName + + "/operationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobOperationResultsGet_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobOperationResultsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Job name whose operation result has to be fetched. + /// OperationID which represents the operation whose result has to be fetched. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobOperationResultsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string jobName, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(jobName),jobName); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// OData filter options. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsExport(string vaultName, string resourceGroupName, string subscriptionId, string Filter, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupJobsExport" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsExport_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// Triggers export of jobs specified by filters and returns an OperationID to track. + /// + /// + /// OData filter options. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsExportViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupJobsExport$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobsExport'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupJobsExport" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsExport_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsExport_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OData filter options. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsExport_Validate(string vaultName, string resourceGroupName, string subscriptionId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// 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. + /// The subscription Id. + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MoveRecoveryPoint(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMoveRpAcrossTiersRequest body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "/recoveryPoints/" + + global::System.Uri.EscapeDataString(recoveryPointId) + + "/move" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MoveRecoveryPoint_Call(request,onDefault,eventListener,sender); + } + } + + /// Move recovery point from one datastore to another store. + /// + /// Move Resource Across Tiers Request + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MoveRecoveryPointViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMoveRpAcrossTiersRequest body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)/recoveryPoints/(?[^/]+)/move$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/move'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + var recoveryPointId = _match.Groups["recoveryPointId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "/recoveryPoints/" + + recoveryPointId + + "/move" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MoveRecoveryPoint_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MoveRecoveryPoint_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MoveRecoveryPoint_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IMoveRpAcrossTiersRequest body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(recoveryPointId),recoveryPointId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// The subscription Id. + /// resource validate operation request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationValidate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupValidateOperation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationValidate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Validate operation for specified backed up item. This is a synchronous operation. + /// + /// + /// resource validate operation request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationValidateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupValidateOperation$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperation'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupValidateOperation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationValidate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationValidate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateOperationsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// resource validate operation request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationValidate_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Returns the list of available operations. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.RecoveryServices/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call(request,onOk,eventListener,sender); + } + } + + /// Returns the list of available operations. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.RecoveryServices/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.RecoveryServices/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.RecoveryServices/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ClientDiscoveryResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// 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 subscription Id. + /// The name of the private endpoint connection. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionDelete(string vaultName, string resourceGroupName, string subscriptionId, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete Private Endpoint requests. This call is made by Backup Admin. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// The name of the private endpoint connection. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionDelete_Validate(string vaultName, string resourceGroupName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// 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 subscription Id. + /// The name of the private endpoint connection. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionGet(string vaultName, string resourceGroupName, string subscriptionId, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get Private Endpoint Connection. This call is made by Backup Admin. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateEndpointConnectionResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// The name of the private endpoint connection. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// 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 subscription Id. + /// The name of the private endpoint connection. + /// Request body for operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionPut(string vaultName, string resourceGroupName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionPut_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + /// + /// Request body for operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionPutViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionPut_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionPut_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PrivateEndpointConnectionResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// The name of the private endpoint connection. + /// Request body for operation + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionPut_Validate(string vaultName, string resourceGroupName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPrivateEndpointConnectionResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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 subscription Id. + /// The name of the private endpoint connection. + /// Operation id + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointGetOperationStatus(string vaultName, string resourceGroupName, string subscriptionId, string privateEndpointConnectionName, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "/operationsStatus/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointGetOperationStatus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the operation status for a private endpoint connection. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointGetOperationStatusViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/privateEndpointConnections/(?[^/]+)/operationsStatus/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "/operationsStatus/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointGetOperationStatus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointGetOperationStatus_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.NewErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// The name of the private endpoint connection. + /// Operation id + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointGetOperationStatus_Validate(string vaultName, string resourceGroupName, string subscriptionId, string privateEndpointConnectionName, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// 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. + /// The subscription Id. + /// + /// OData filter options. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectableContainersList(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectableContainers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectableContainersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the containers that can be registered to Recovery Services Vault. + /// + /// OData filter options. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectableContainersListViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectableContainers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectableContainers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectableContainersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectableContainersList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectableContainerResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// + /// OData filter options. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectableContainersList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// 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. + /// The subscription Id. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectedItemOperationResultsGet(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "/operationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectedItemOperationResultsGet_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// Fetches the result of any operation on the backup item. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectedItemOperationResultsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)/operationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "/operationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectedItemOperationResultsGet_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectedItemOperationResultsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItemResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectedItemOperationResultsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectedItemOperationStatusesGet(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "/operationsStatus/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectedItemOperationStatusesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectedItemOperationStatusesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)/operationsStatus/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "/operationsStatus/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectedItemOperationStatusesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectedItemOperationStatusesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectedItemOperationStatusesGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// Fabric name associated with the backup item. + /// Container name associated with the backup item. + /// Item name to be backed up. + /// resource backed up item + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectedItemsCreateOrUpdate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectedItemsCreateOrUpdate_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// resource backed up item + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectedItemsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectedItemsCreateOrUpdate_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectedItemsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItemResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric name associated with the backup item. + /// Container name associated with the backup item. + /// Item name to be backed up. + /// resource backed up item + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectedItemsCreateOrUpdate_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectedItemResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), 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 name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric name associated with the backed up item. + /// Container name associated with the backed up item. + /// Backed up item to be deleted. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectedItemsDelete(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectedItemsDelete_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectedItemsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectedItemsDelete_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectedItemsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric name associated with the backed up item. + /// Container name associated with the backed up item. + /// Backed up item to be deleted. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectedItemsDelete_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + } + } + + /// + /// 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. + /// The subscription Id. + /// 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 filter options. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectedItemsGet(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectedItemsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Provides the details of the backed up item. This is an asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// OData filter options. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectedItemsGetViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectedItemsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectedItemsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectedItemResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// 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 filter options. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectedItemsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// 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. + /// The subscription Id. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainerOperationResultsGet(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/operationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainerOperationResultsGet_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// Fetches the result of any operation on the container. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainerOperationResultsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/operationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/operationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainerOperationResultsGet_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainerOperationResultsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainerOperationResultsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// Fabric name associated with the container. + /// Operation ID associated with the operation whose result needs to be fetched. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainerRefreshOperationResultsGet(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string operationId, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/operationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainerRefreshOperationResultsGet_Call(request,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Provides the result of the refresh operation triggered by the BeginRefresh operation. + /// + /// + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainerRefreshOperationResultsGetViaIdentity(global::System.String viaIdentity, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/operationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/operationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainerRefreshOperationResultsGet_Call(request,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainerRefreshOperationResultsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric name associated with the container. + /// Operation ID associated with the operation whose result needs to be fetched. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainerRefreshOperationResultsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// Name of the fabric where the container belongs. + /// Name of the container whose details need to be fetched. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainersGet(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets details of the specific container registered to your Recovery Services Vault. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Name of the fabric where the container belongs. + /// Name of the container whose details need to be fetched. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainersGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + } + } + + /// + /// 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. + /// The subscription Id. + /// Fabric Name associated with the container. + /// Name of the container in which inquiry needs to be triggered. + /// OData filter options. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainersInquire(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string Filter, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/inquire" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainersInquire_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// This is an async operation and the results should be tracked using location header or Azure-async-url. + /// + /// + /// OData filter options. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainersInquireViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/inquire$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/inquire" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainersInquire_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainersInquire_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric Name associated with the container. + /// Name of the container in which inquiry needs to be triggered. + /// OData filter options. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainersInquire_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// 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. + /// The subscription Id. + /// Fabric name associated the container. + /// OData filter options. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainersRefresh(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string Filter, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/refreshContainers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainersRefresh_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// OData filter options. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainersRefreshViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/refreshContainers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/refreshContainers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainersRefresh_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainersRefresh_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric name associated the container. + /// OData filter options. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainersRefresh_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// 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. + /// The subscription Id. + /// Fabric name associated with the container. + /// Name of the container to be registered. + /// Request body for operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainersRegister(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainersRegister_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// Request body for operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainersRegisterViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainersRegister_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainersRegister_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionContainerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric name associated with the container. + /// Name of the container to be registered. + /// Request body for operation + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainersRegister_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionContainerResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), 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 name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Name of the fabric where the container belongs. + /// Name of the container which needs to be unregistered from the Recovery Services Vault. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainersUnregister(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainersUnregister_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionContainersUnregisterViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionContainersUnregister_Call(request,onOk,onAccepted,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainersUnregister_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Name of the fabric where the container belongs. + /// Name of the container which needs to be unregistered from the Recovery Services Vault. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionContainersUnregister_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + } + } + + /// 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. + /// The subscription Id. + /// Fabric name associated with the backup item. + /// Intent object name. + /// resource backed up item + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionIntentCreateOrUpdate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string intentObjectName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/backupProtectionIntent/" + + global::System.Uri.EscapeDataString(intentObjectName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionIntentCreateOrUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// Create Intent for Enabling backup of an item. This is a synchronous operation. + /// + /// resource backed up item + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionIntentCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/backupProtectionIntent/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var intentObjectName = _match.Groups["intentObjectName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/backupProtectionIntent/" + + intentObjectName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionIntentCreateOrUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionIntentCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntentResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric name associated with the backup item. + /// Intent object name. + /// resource backed up item + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionIntentCreateOrUpdate_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string intentObjectName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionIntentResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(intentObjectName),intentObjectName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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. + /// The subscription Id. + /// Fabric name associated with the intent. + /// Intent to be deleted. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionIntentDelete(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string intentObjectName, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/backupProtectionIntent/" + + global::System.Uri.EscapeDataString(intentObjectName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionIntentDelete_Call(request,onNoContent,eventListener,sender); + } + } + + /// Used to remove intent from an item + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionIntentDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/backupProtectionIntent/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var intentObjectName = _match.Groups["intentObjectName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/backupProtectionIntent/" + + intentObjectName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionIntentDelete_Call(request,onNoContent,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionIntentDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric name associated with the intent. + /// Intent to be deleted. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionIntentDelete_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string intentObjectName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(intentObjectName),intentObjectName); + } + } + + /// + /// 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. + /// The subscription Id. + /// Fabric name associated with the backed up item. + /// Backed up item name whose details are to be fetched. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionIntentGet(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string intentObjectName, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/backupProtectionIntent/" + + global::System.Uri.EscapeDataString(intentObjectName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionIntentGet_Call(request,onOk,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionIntentGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/backupProtectionIntent/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var intentObjectName = _match.Groups["intentObjectName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/backupProtectionIntent/" + + intentObjectName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionIntentGet_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionIntentGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionIntentResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Fabric name associated with the backed up item. + /// Backed up item name whose details are to be fetched. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionIntentGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string intentObjectName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(intentObjectName),intentObjectName); + } + } + + /// + /// 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 + /// The subscription Id. + /// Enable backup validation request on Virtual Machine + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionIntentValidate(string azureRegion, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.RecoveryServices/locations/" + + global::System.Uri.EscapeDataString(azureRegion) + + "/backupPreValidateProtection" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionIntentValidate_Call(request,onOk,eventListener,sender); + } + } + + /// + /// It will validate followings + /// 1. Vault capacity + /// 2. VM is already protected + /// 3. Any VM related configuration passed in properties. + /// + /// + /// Enable backup validation request on Virtual Machine + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionIntentValidateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/Subscriptions/(?[^/]+)/providers/Microsoft.RecoveryServices/locations/(?[^/]+)/backupPreValidateProtection$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection'"); + } + + // replace URI parameters with values from identity + var azureRegion = _match.Groups["azureRegion"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/Subscriptions/" + + subscriptionId + + "/providers/Microsoft.RecoveryServices/locations/" + + azureRegion + + "/backupPreValidateProtection" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionIntentValidate_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionIntentValidate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.PreValidateEnableBackupResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Azure region to hit Api + /// The subscription Id. + /// Enable backup validation request on Virtual Machine + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionIntentValidate_Validate(string azureRegion, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IPreValidateEnableBackupRequest body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(azureRegion),azureRegion); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// The subscription Id. + /// Backup policy to be created. + /// resource backup policy + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionPoliciesCreateOrUpdate(string vaultName, string resourceGroupName, string subscriptionId, string policyName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupPolicies/" + + global::System.Uri.EscapeDataString(policyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionPoliciesCreateOrUpdate_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched + /// using GetPolicyOperationResult API. + /// + /// + /// resource backup policy + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionPoliciesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var policyName = _match.Groups["policyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupPolicies/" + + policyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionPoliciesCreateOrUpdate_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionPoliciesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicyResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Backup policy to be created. + /// resource backup policy + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionPoliciesCreateOrUpdate_Validate(string vaultName, string resourceGroupName, string subscriptionId, string policyName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IProtectionPolicyResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(policyName),policyName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), 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 name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Backup policy to be deleted. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionPoliciesDelete(string vaultName, string resourceGroupName, string subscriptionId, string policyName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupPolicies/" + + global::System.Uri.EscapeDataString(policyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionPoliciesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var policyName = _match.Groups["policyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupPolicies/" + + policyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionPoliciesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Backup policy to be deleted. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionPoliciesDelete_Validate(string vaultName, string resourceGroupName, string subscriptionId, string policyName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(policyName),policyName); + } + } + + /// + /// 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. + /// The subscription Id. + /// Backup policy information to be fetched. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionPoliciesGet(string vaultName, string resourceGroupName, string subscriptionId, string policyName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupPolicies/" + + global::System.Uri.EscapeDataString(policyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionPoliciesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var policyName = _match.Groups["policyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupPolicies/" + + policyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionPoliciesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicyResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Backup policy information to be fetched. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionPoliciesGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string policyName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(policyName),policyName); + } + } + + /// 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. + /// The subscription Id. + /// Backup policy name whose operation's result needs to be fetched. + /// Operation ID which represents the operation whose result needs to be fetched. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionPolicyOperationResultsGet(string vaultName, string resourceGroupName, string subscriptionId, string policyName, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupPolicies/" + + global::System.Uri.EscapeDataString(policyName) + + "/operationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionPolicyOperationResultsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Provides the result of an operation. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionPolicyOperationResultsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupPolicies/(?[^/]+)/operationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var policyName = _match.Groups["policyName"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupPolicies/" + + policyName + + "/operationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionPolicyOperationResultsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionPolicyOperationResultsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ProtectionPolicyResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Backup policy name whose operation's result needs to be fetched. + /// Operation ID which represents the operation whose result needs to be fetched. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionPolicyOperationResultsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string policyName, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(policyName),policyName); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// Backup policy name whose operation's status needs to be fetched. + /// Operation ID which represents an operation whose status needs to be fetched. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionPolicyOperationStatusesGet(string vaultName, string resourceGroupName, string subscriptionId, string policyName, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupPolicies/" + + global::System.Uri.EscapeDataString(policyName) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionPolicyOperationStatusesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProtectionPolicyOperationStatusesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupPolicies/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var policyName = _match.Groups["policyName"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupPolicies/" + + policyName + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProtectionPolicyOperationStatusesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionPolicyOperationStatusesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// Backup policy name whose operation's status needs to be fetched. + /// Operation ID which represents an operation whose status needs to be fetched. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProtectionPolicyOperationStatusesGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string policyName, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(policyName),policyName); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RecoveryPointsGet(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "/recoveryPoints/" + + global::System.Uri.EscapeDataString(recoveryPointId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RecoveryPointsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RecoveryPointsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)/recoveryPoints/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + var recoveryPointId = _match.Groups["recoveryPointId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "/recoveryPoints/" + + recoveryPointId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RecoveryPointsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RecoveryPointsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RecoveryPointsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(recoveryPointId),recoveryPointId); + } + } + + /// 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. + /// The subscription Id. + /// 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 filter options. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RecoveryPointsList(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "/recoveryPoints" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RecoveryPointsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the backup copies for the backed up item. + /// + /// OData filter options. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RecoveryPointsListViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)/recoveryPoints$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "/recoveryPoints" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RecoveryPointsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RecoveryPointsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// 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 filter options. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RecoveryPointsList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// 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. + /// The subscription Id. + /// + /// + /// + /// List Recovery points Recommended for Move Request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RecoveryPointsRecommendedForMoveList(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IListRecoveryPointsRecommendedForMoveRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "/recoveryPointsRecommendedForMove" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RecoveryPointsRecommendedForMoveList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the recovery points recommended for move to another tier + /// + /// List Recovery points Recommended for Move Request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RecoveryPointsRecommendedForMoveListViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IListRecoveryPointsRecommendedForMoveRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)/recoveryPointsRecommendedForMove$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPointsRecommendedForMove'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "/recoveryPointsRecommendedForMove" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RecoveryPointsRecommendedForMoveList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RecoveryPointsRecommendedForMoveList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.RecoveryPointResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// + /// + /// + /// List Recovery points Recommended for Move Request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RecoveryPointsRecommendedForMoveList_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IListRecoveryPointsRecommendedForMoveRequest body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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 subscription Id. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceGuardProxiesGet(string vaultName, string resourceGroupName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupResourceGuardProxies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceGuardProxiesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List the ResourceGuardProxies under vault + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceGuardProxiesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupResourceGuardProxies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupResourceGuardProxies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceGuardProxiesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceGuardProxiesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceGuardProxyBaseResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceGuardProxiesGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// 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 subscription Id. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceGuardProxyDelete(string vaultName, string resourceGroupName, string subscriptionId, string resourceGuardProxyName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupResourceGuardProxies/" + + global::System.Uri.EscapeDataString(resourceGuardProxyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceGuardProxyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete ResourceGuardProxy under vault + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceGuardProxyDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupResourceGuardProxies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGuardProxyName = _match.Groups["resourceGuardProxyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupResourceGuardProxies/" + + resourceGuardProxyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceGuardProxyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceGuardProxyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceGuardProxyDelete_Validate(string vaultName, string resourceGroupName, string subscriptionId, string resourceGuardProxyName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGuardProxyName),resourceGuardProxyName); + } + } + + /// 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 subscription Id. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceGuardProxyGet(string vaultName, string resourceGroupName, string subscriptionId, string resourceGuardProxyName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupResourceGuardProxies/" + + global::System.Uri.EscapeDataString(resourceGuardProxyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceGuardProxyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns ResourceGuardProxy under vault and with the name referenced in request + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceGuardProxyGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupResourceGuardProxies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGuardProxyName = _match.Groups["resourceGuardProxyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupResourceGuardProxies/" + + resourceGuardProxyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceGuardProxyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceGuardProxyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceGuardProxyBaseResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceGuardProxyGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string resourceGuardProxyName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGuardProxyName),resourceGuardProxyName); + } + } + + /// + /// 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 subscription Id. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceGuardProxyPut(string vaultName, string resourceGroupName, string subscriptionId, string resourceGuardProxyName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupResourceGuardProxies/" + + global::System.Uri.EscapeDataString(resourceGuardProxyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceGuardProxyPut_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Add or Update ResourceGuardProxy under vault + /// Secures vault critical operations + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceGuardProxyPutViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupResourceGuardProxies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGuardProxyName = _match.Groups["resourceGuardProxyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupResourceGuardProxies/" + + resourceGuardProxyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceGuardProxyPut_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceGuardProxyPut_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ResourceGuardProxyBaseResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceGuardProxyPut_Validate(string vaultName, string resourceGroupName, string subscriptionId, string resourceGuardProxyName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGuardProxyName),resourceGuardProxyName); + } + } + + /// Secures delete ResourceGuardProxy operations. + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// + /// Request body for operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceGuardProxyUnlockDelete(string vaultName, string resourceGroupName, string subscriptionId, string resourceGuardProxyName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupResourceGuardProxies/" + + global::System.Uri.EscapeDataString(resourceGuardProxyName) + + "/unlockDelete" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceGuardProxyUnlockDelete_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Secures delete ResourceGuardProxy operations. + /// + /// Request body for operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResourceGuardProxyUnlockDeleteViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupResourceGuardProxies/(?[^/]+)/unlockDelete$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGuardProxyName = _match.Groups["resourceGuardProxyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupResourceGuardProxies/" + + resourceGuardProxyName + + "/unlockDelete" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResourceGuardProxyUnlockDelete_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceGuardProxyUnlockDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.UnlockDeleteResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// + /// Request body for operation + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResourceGuardProxyUnlockDelete_Validate(string vaultName, string resourceGroupName, string subscriptionId, string resourceGuardProxyName, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IUnlockDeleteRequest body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGuardProxyName),resourceGuardProxyName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// The subscription Id. + /// 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 + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RestoresTrigger(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestResource body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupFabrics/" + + global::System.Uri.EscapeDataString(fabricName) + + "/protectionContainers/" + + global::System.Uri.EscapeDataString(containerName) + + "/protectedItems/" + + global::System.Uri.EscapeDataString(protectedItemName) + + "/recoveryPoints/" + + global::System.Uri.EscapeDataString(recoveryPointId) + + "/restore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RestoresTrigger_Call(request,onDefault,eventListener,sender); + } + } + + /// + /// Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// resource restore request + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RestoresTriggerViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestResource body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupFabrics/(?[^/]+)/protectionContainers/(?[^/]+)/protectedItems/(?[^/]+)/recoveryPoints/(?[^/]+)/restore$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fabricName = _match.Groups["fabricName"].Value; + var containerName = _match.Groups["containerName"].Value; + var protectedItemName = _match.Groups["protectedItemName"].Value; + var recoveryPointId = _match.Groups["recoveryPointId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupFabrics/" + + fabricName + + "/protectionContainers/" + + containerName + + "/protectedItems/" + + protectedItemName + + "/recoveryPoints/" + + recoveryPointId + + "/restore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RestoresTrigger_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RestoresTrigger_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// 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 + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RestoresTrigger_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IRestoreRequestResource body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(fabricName),fabricName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(protectedItemName),protectedItemName); + await eventListener.AssertNotNull(nameof(recoveryPointId),recoveryPointId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get the security PIN. + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// security pin request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SecurityPiNsGet(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISecurityPinBase body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupSecurityPIN" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SecurityPiNsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the security PIN. + /// + /// security pin request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SecurityPiNsGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISecurityPinBase body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupSecurityPIN$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupSecurityPIN" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SecurityPiNsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SecurityPiNsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.TokenInformation.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// security pin request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SecurityPiNsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ISecurityPinBase body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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. + /// The subscription Id. + /// OperationID which represents the operation whose result needs to be fetched. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ValidateOperationResultsGet(string vaultName, string resourceGroupName, string subscriptionId, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupValidateOperationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ValidateOperationResultsGet_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// Fetches the result of a triggered validate operation. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ValidateOperationResultsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupValidateOperationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupValidateOperationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ValidateOperationResultsGet_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ValidateOperationResultsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.ValidateOperationsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OperationID which represents the operation whose result needs to be fetched. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ValidateOperationResultsGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// OperationID represents the operation whose status needs to be fetched. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ValidateOperationStatusesGet(string vaultName, string resourceGroupName, string subscriptionId, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupValidateOperationsStatuses/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ValidateOperationStatusesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ValidateOperationStatusesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupValidateOperationsStatuses/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationsStatuses/{operationId}'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupValidateOperationsStatuses/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ValidateOperationStatusesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ValidateOperationStatusesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// OperationID represents the operation whose status needs to be fetched. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ValidateOperationStatusesGet_Validate(string vaultName, string resourceGroupName, string subscriptionId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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. + /// The subscription Id. + /// resource validate operation request + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ValidateOperationTrigger(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.RecoveryServices/vaults/" + + global::System.Uri.EscapeDataString(vaultName) + + "/backupTriggerValidateOperation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ValidateOperationTrigger_Call(request,onDefault,eventListener,sender); + } + } + + /// + /// Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking headers which + /// can be tracked using GetValidateOperationResult API. + /// + /// + /// resource validate operation request + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ValidateOperationTriggerViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-12-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.RecoveryServices/vaults/(?[^/]+)/backupTriggerValidateOperation$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTriggerValidateOperation'"); + } + + // replace URI parameters with values from identity + var vaultName = _match.Groups["vaultName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.RecoveryServices/vaults/" + + vaultName + + "/backupTriggerValidateOperation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ValidateOperationTrigger_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ValidateOperationTrigger_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the recovery services vault. + /// The name of the resource group where the recovery services vault is present. + /// The subscription Id. + /// resource validate operation request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ValidateOperationTrigger_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20211201.IValidateOperationRequest body, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(vaultName),vaultName); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/AcquireStorageAccountLock.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/AcquireStorageAccountLock.cs new file mode 100644 index 000000000000..2dfc4ad1e4ba --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/AcquireStorageAccountLock.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Whether storage account lock is to be acquired for this container or not. + public partial struct AcquireStorageAccountLock : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock Acquire = @"Acquire"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock NotAcquire = @"NotAcquire"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private AcquireStorageAccountLock(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AcquireStorageAccountLock + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AcquireStorageAccountLock(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AcquireStorageAccountLock + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AcquireStorageAccountLock (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AcquireStorageAccountLock && Equals((AcquireStorageAccountLock)obj); + } + + /// Returns hashCode for enum AcquireStorageAccountLock + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AcquireStorageAccountLock + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AcquireStorageAccountLock + /// the value to convert to an instance of . + + public static implicit operator AcquireStorageAccountLock(string value) + { + return new AcquireStorageAccountLock(value); + } + + /// Implicit operator to convert AcquireStorageAccountLock to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock e) + { + return e._value; + } + + /// Overriding != operator for enum AcquireStorageAccountLock + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AcquireStorageAccountLock + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AcquireStorageAccountLock e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/AzureFileShareType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/AzureFileShareType.cs new file mode 100644 index 000000000000..f7d7af48cb56 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/AzureFileShareType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// File Share type XSync or XSMB. + public partial struct AzureFileShareType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType XSync = @"XSync"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType Xsmb = @"XSMB"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private AzureFileShareType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AzureFileShareType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AzureFileShareType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AzureFileShareType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AzureFileShareType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AzureFileShareType && Equals((AzureFileShareType)obj); + } + + /// Returns hashCode for enum AzureFileShareType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AzureFileShareType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AzureFileShareType + /// the value to convert to an instance of . + + public static implicit operator AzureFileShareType(string value) + { + return new AzureFileShareType(value); + } + + /// Implicit operator to convert AzureFileShareType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType e) + { + return e._value; + } + + /// Overriding != operator for enum AzureFileShareType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AzureFileShareType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.AzureFileShareType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/BackupEngineType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/BackupEngineType.cs new file mode 100644 index 000000000000..3cbce9790f33 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/BackupEngineType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of the backup engine. + public partial struct BackupEngineType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType AzureBackupServerEngine = @"AzureBackupServerEngine"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType DpmBackupEngine = @"DpmBackupEngine"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private BackupEngineType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BackupEngineType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BackupEngineType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BackupEngineType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BackupEngineType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BackupEngineType && Equals((BackupEngineType)obj); + } + + /// Returns hashCode for enum BackupEngineType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BackupEngineType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BackupEngineType + /// the value to convert to an instance of . + + public static implicit operator BackupEngineType(string value) + { + return new BackupEngineType(value); + } + + /// Implicit operator to convert BackupEngineType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType e) + { + return e._value; + } + + /// Overriding != operator for enum BackupEngineType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BackupEngineType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupEngineType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/BackupItemType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/BackupItemType.cs new file mode 100644 index 000000000000..34add918c75c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/BackupItemType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of backup items associated with this container. + public partial struct BackupItemType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType AzureFileShare = @"AzureFileShare"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType AzureSqlDb = @"AzureSqlDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType Client = @"Client"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType Exchange = @"Exchange"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType FileFolder = @"FileFolder"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType GenericDataSource = @"GenericDataSource"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType SapAseDatabase = @"SAPAseDatabase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType SapHanaDatabase = @"SAPHanaDatabase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType Sharepoint = @"Sharepoint"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType SqlDataBase = @"SQLDataBase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType Sqldb = @"SQLDB"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType SystemState = @"SystemState"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType VM = @"VM"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType VMwareVM = @"VMwareVM"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private BackupItemType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BackupItemType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BackupItemType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BackupItemType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BackupItemType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BackupItemType && Equals((BackupItemType)obj); + } + + /// Returns hashCode for enum BackupItemType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BackupItemType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BackupItemType + /// the value to convert to an instance of . + + public static implicit operator BackupItemType(string value) + { + return new BackupItemType(value); + } + + /// Implicit operator to convert BackupItemType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType e) + { + return e._value; + } + + /// Overriding != operator for enum BackupItemType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BackupItemType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupItemType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/BackupManagementType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/BackupManagementType.cs new file mode 100644 index 000000000000..b55315b870cb --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/BackupManagementType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Backup management type to execute the current job. + public partial struct BackupManagementType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType AzureBackupServer = @"AzureBackupServer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType AzureIaasVM = @"AzureIaasVM"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType AzureSql = @"AzureSql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType AzureStorage = @"AzureStorage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType AzureWorkload = @"AzureWorkload"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType DefaultBackup = @"DefaultBackup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType Dpm = @"DPM"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType Mab = @"MAB"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private BackupManagementType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BackupManagementType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BackupManagementType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BackupManagementType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BackupManagementType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BackupManagementType && Equals((BackupManagementType)obj); + } + + /// Returns hashCode for enum BackupManagementType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BackupManagementType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BackupManagementType + /// the value to convert to an instance of . + + public static implicit operator BackupManagementType(string value) + { + return new BackupManagementType(value); + } + + /// Implicit operator to convert BackupManagementType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType e) + { + return e._value; + } + + /// Overriding != operator for enum BackupManagementType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BackupManagementType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/BackupType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/BackupType.cs new file mode 100644 index 000000000000..f2ca2001b77e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/BackupType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of backup, viz. Full, Differential, Log or CopyOnlyFull + public partial struct BackupType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType CopyOnlyFull = @"CopyOnlyFull"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType Differential = @"Differential"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType Full = @"Full"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType Incremental = @"Incremental"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType Log = @"Log"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private BackupType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BackupType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BackupType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BackupType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BackupType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BackupType && Equals((BackupType)obj); + } + + /// Returns hashCode for enum BackupType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BackupType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BackupType + /// the value to convert to an instance of . + + public static implicit operator BackupType(string value) + { + return new BackupType(value); + } + + /// Implicit operator to convert BackupType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType e) + { + return e._value; + } + + /// Overriding != operator for enum BackupType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BackupType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/ContainerType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/ContainerType.cs new file mode 100644 index 000000000000..42316a9c50ac --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/ContainerType.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of container for filter + public partial struct ContainerType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType AzureBackupServerContainer = @"AzureBackupServerContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType AzureSqlContainer = @"AzureSqlContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType AzureWorkloadContainer = @"AzureWorkloadContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType Cluster = @"Cluster"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType DpmContainer = @"DPMContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType GenericContainer = @"GenericContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType IaasVMContainer = @"IaasVMContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType IaasVMServiceContainer = @"IaasVMServiceContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType MabContainer = @"MABContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType MicrosoftClassicComputeVirtualMachines = @"Microsoft.ClassicCompute/virtualMachines"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType MicrosoftComputeVirtualMachines = @"Microsoft.Compute/virtualMachines"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType SqlagWorkLoadContainer = @"SQLAGWorkLoadContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType StorageContainer = @"StorageContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType Unknown = @"Unknown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType VCenter = @"VCenter"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType VMAppContainer = @"VMAppContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType Windows = @"Windows"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private ContainerType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ContainerType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ContainerType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ContainerType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ContainerType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ContainerType && Equals((ContainerType)obj); + } + + /// Returns hashCode for enum ContainerType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ContainerType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ContainerType + /// the value to convert to an instance of . + + public static implicit operator ContainerType(string value) + { + return new ContainerType(value); + } + + /// Implicit operator to convert ContainerType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType e) + { + return e._value; + } + + /// Overriding != operator for enum ContainerType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ContainerType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ContainerType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/CopyOptions.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/CopyOptions.cs new file mode 100644 index 000000000000..ee2a43f993d5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/CopyOptions.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Options to resolve copy conflicts. + public partial struct CopyOptions : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions CreateCopy = @"CreateCopy"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions FailOnConflict = @"FailOnConflict"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions Overwrite = @"Overwrite"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions Skip = @"Skip"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private CopyOptions(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to CopyOptions + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CopyOptions(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type CopyOptions + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CopyOptions (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CopyOptions && Equals((CopyOptions)obj); + } + + /// Returns hashCode for enum CopyOptions + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CopyOptions + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CopyOptions + /// the value to convert to an instance of . + + public static implicit operator CopyOptions(string value) + { + return new CopyOptions(value); + } + + /// Implicit operator to convert CopyOptions to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions e) + { + return e._value; + } + + /// Overriding != operator for enum CopyOptions + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CopyOptions + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/CreateMode.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/CreateMode.cs new file mode 100644 index 000000000000..8a1edda5229c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/CreateMode.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + public partial struct CreateMode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode Default = @"Default"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode Recover = @"Recover"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to CreateMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CreateMode(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private CreateMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type CreateMode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CreateMode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CreateMode && Equals((CreateMode)obj); + } + + /// Returns hashCode for enum CreateMode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CreateMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CreateMode + /// the value to convert to an instance of . + + public static implicit operator CreateMode(string value) + { + return new CreateMode(value); + } + + /// Implicit operator to convert CreateMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode e) + { + return e._value; + } + + /// Overriding != operator for enum CreateMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CreateMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/DataMoveLevel.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/DataMoveLevel.cs new file mode 100644 index 000000000000..6127b6557460 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/DataMoveLevel.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// DataMove Level + public partial struct DataMoveLevel : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel Container = @"Container"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel Vault = @"Vault"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DataMoveLevel + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DataMoveLevel(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DataMoveLevel(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DataMoveLevel + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DataMoveLevel (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DataMoveLevel && Equals((DataMoveLevel)obj); + } + + /// Returns hashCode for enum DataMoveLevel + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DataMoveLevel + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DataMoveLevel + /// the value to convert to an instance of . + + public static implicit operator DataMoveLevel(string value) + { + return new DataMoveLevel(value); + } + + /// Implicit operator to convert DataMoveLevel to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel e) + { + return e._value; + } + + /// Overriding != operator for enum DataMoveLevel + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DataMoveLevel + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataMoveLevel e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/DataSourceType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/DataSourceType.cs new file mode 100644 index 000000000000..cba453a66c8e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/DataSourceType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of workload this item represents. + public partial struct DataSourceType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType AzureFileShare = @"AzureFileShare"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType AzureSqlDb = @"AzureSqlDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType Client = @"Client"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType Exchange = @"Exchange"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType FileFolder = @"FileFolder"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType GenericDataSource = @"GenericDataSource"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType SapAseDatabase = @"SAPAseDatabase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType SapHanaDatabase = @"SAPHanaDatabase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType Sharepoint = @"Sharepoint"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType SqlDataBase = @"SQLDataBase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType Sqldb = @"SQLDB"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType SystemState = @"SystemState"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType VM = @"VM"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType VMwareVM = @"VMwareVM"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DataSourceType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DataSourceType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DataSourceType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DataSourceType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DataSourceType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DataSourceType && Equals((DataSourceType)obj); + } + + /// Returns hashCode for enum DataSourceType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DataSourceType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DataSourceType + /// the value to convert to an instance of . + + public static implicit operator DataSourceType(string value) + { + return new DataSourceType(value); + } + + /// Implicit operator to convert DataSourceType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType e) + { + return e._value; + } + + /// Overriding != operator for enum DataSourceType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DataSourceType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/DayOfWeek.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/DayOfWeek.cs new file mode 100644 index 000000000000..9cbf313455c5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/DayOfWeek.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + public partial struct DayOfWeek : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek Friday = @"Friday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek Monday = @"Monday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek Saturday = @"Saturday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek Sunday = @"Sunday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek Thursday = @"Thursday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek Tuesday = @"Tuesday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek Wednesday = @"Wednesday"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DayOfWeek + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DayOfWeek(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DayOfWeek(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DayOfWeek + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DayOfWeek (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DayOfWeek && Equals((DayOfWeek)obj); + } + + /// Returns hashCode for enum DayOfWeek + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DayOfWeek + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DayOfWeek + /// the value to convert to an instance of . + + public static implicit operator DayOfWeek(string value) + { + return new DayOfWeek(value); + } + + /// Implicit operator to convert DayOfWeek to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek e) + { + return e._value; + } + + /// Overriding != operator for enum DayOfWeek + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DayOfWeek + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DayOfWeek e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/DedupState.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/DedupState.cs new file mode 100644 index 000000000000..65bfb910cb70 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/DedupState.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Vault Dedup state + public partial struct DedupState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState Enabled = @"Enabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DedupState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DedupState(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DedupState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DedupState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DedupState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DedupState && Equals((DedupState)obj); + } + + /// Returns hashCode for enum DedupState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DedupState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DedupState + /// the value to convert to an instance of . + + public static implicit operator DedupState(string value) + { + return new DedupState(value); + } + + /// Implicit operator to convert DedupState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState e) + { + return e._value; + } + + /// Overriding != operator for enum DedupState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DedupState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DedupState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/EncryptionAtRestType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/EncryptionAtRestType.cs new file mode 100644 index 000000000000..204a037dcb83 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/EncryptionAtRestType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Encryption At Rest Type + public partial struct EncryptionAtRestType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType CustomerManaged = @"CustomerManaged"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType MicrosoftManaged = @"MicrosoftManaged"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EncryptionAtRestType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EncryptionAtRestType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private EncryptionAtRestType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type EncryptionAtRestType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EncryptionAtRestType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EncryptionAtRestType && Equals((EncryptionAtRestType)obj); + } + + /// Returns hashCode for enum EncryptionAtRestType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EncryptionAtRestType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EncryptionAtRestType + /// the value to convert to an instance of . + + public static implicit operator EncryptionAtRestType(string value) + { + return new EncryptionAtRestType(value); + } + + /// Implicit operator to convert EncryptionAtRestType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType e) + { + return e._value; + } + + /// Overriding != operator for enum EncryptionAtRestType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EncryptionAtRestType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EncryptionAtRestType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/EnhancedSecurityState.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/EnhancedSecurityState.cs new file mode 100644 index 000000000000..fd48915ae507 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/EnhancedSecurityState.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Enabled or Disabled. + public partial struct EnhancedSecurityState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState Enabled = @"Enabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EnhancedSecurityState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EnhancedSecurityState(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private EnhancedSecurityState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type EnhancedSecurityState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EnhancedSecurityState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EnhancedSecurityState && Equals((EnhancedSecurityState)obj); + } + + /// Returns hashCode for enum EnhancedSecurityState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EnhancedSecurityState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EnhancedSecurityState + /// the value to convert to an instance of . + + public static implicit operator EnhancedSecurityState(string value) + { + return new EnhancedSecurityState(value); + } + + /// Implicit operator to convert EnhancedSecurityState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState e) + { + return e._value; + } + + /// Overriding != operator for enum EnhancedSecurityState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EnhancedSecurityState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.EnhancedSecurityState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/FabricName.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/FabricName.cs new file mode 100644 index 000000000000..f60b362f2ea8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/FabricName.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Specifies the fabric name - Azure or AD + public partial struct FabricName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName Azure = @"Azure"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to FabricName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new FabricName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type FabricName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type FabricName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is FabricName && Equals((FabricName)obj); + } + + /// Creates an instance of the + /// the value to create an instance for. + private FabricName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum FabricName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for FabricName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to FabricName + /// the value to convert to an instance of . + + public static implicit operator FabricName(string value) + { + return new FabricName(value); + } + + /// Implicit operator to convert FabricName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName e) + { + return e._value; + } + + /// Overriding != operator for enum FabricName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum FabricName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.FabricName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/HealthState.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/HealthState.cs new file mode 100644 index 000000000000..03f052b51911 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/HealthState.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Health State for the backed up item. + public partial struct HealthState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState ActionRequired = @"ActionRequired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState ActionSuggested = @"ActionSuggested"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState Passed = @"Passed"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to HealthState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new HealthState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type HealthState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type HealthState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is HealthState && Equals((HealthState)obj); + } + + /// Returns hashCode for enum HealthState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private HealthState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for HealthState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to HealthState + /// the value to convert to an instance of . + + public static implicit operator HealthState(string value) + { + return new HealthState(value); + } + + /// Implicit operator to convert HealthState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState e) + { + return e._value; + } + + /// Overriding != operator for enum HealthState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum HealthState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/HealthStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/HealthStatus.cs new file mode 100644 index 000000000000..4899e8840fac --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/HealthStatus.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Health status of protected item. + public partial struct HealthStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus ActionRequired = @"ActionRequired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus ActionSuggested = @"ActionSuggested"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus Passed = @"Passed"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to HealthStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new HealthStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type HealthStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type HealthStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is HealthStatus && Equals((HealthStatus)obj); + } + + /// Returns hashCode for enum HealthStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private HealthStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for HealthStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to HealthStatus + /// the value to convert to an instance of . + + public static implicit operator HealthStatus(string value) + { + return new HealthStatus(value); + } + + /// Implicit operator to convert HealthStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus e) + { + return e._value; + } + + /// Overriding != operator for enum HealthStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum HealthStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/HttpStatusCode.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/HttpStatusCode.cs new file mode 100644 index 000000000000..a0daf2437868 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/HttpStatusCode.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// HTTP Status Code of the operation. + public partial struct HttpStatusCode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Accepted = @"Accepted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Ambiguous = @"Ambiguous"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode BadGateway = @"BadGateway"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode BadRequest = @"BadRequest"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Conflict = @"Conflict"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Continue = @"Continue"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Created = @"Created"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode ExpectationFailed = @"ExpectationFailed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Forbidden = @"Forbidden"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Found = @"Found"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode GatewayTimeout = @"GatewayTimeout"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Gone = @"Gone"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode HttpVersionNotSupported = @"HttpVersionNotSupported"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode InternalServerError = @"InternalServerError"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode LengthRequired = @"LengthRequired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode MethodNotAllowed = @"MethodNotAllowed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Moved = @"Moved"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode MovedPermanently = @"MovedPermanently"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode MultipleChoices = @"MultipleChoices"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode NoContent = @"NoContent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode NonAuthoritativeInformation = @"NonAuthoritativeInformation"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode NotAcceptable = @"NotAcceptable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode NotFound = @"NotFound"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode NotImplemented = @"NotImplemented"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode NotModified = @"NotModified"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Ok = @"OK"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode PartialContent = @"PartialContent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode PaymentRequired = @"PaymentRequired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode PreconditionFailed = @"PreconditionFailed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode ProxyAuthenticationRequired = @"ProxyAuthenticationRequired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Redirect = @"Redirect"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode RedirectKeepVerb = @"RedirectKeepVerb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode RedirectMethod = @"RedirectMethod"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode RequestEntityTooLarge = @"RequestEntityTooLarge"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode RequestTimeout = @"RequestTimeout"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode RequestUriTooLong = @"RequestUriTooLong"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode RequestedRangeNotSatisfiable = @"RequestedRangeNotSatisfiable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode ResetContent = @"ResetContent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode SeeOther = @"SeeOther"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode ServiceUnavailable = @"ServiceUnavailable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode SwitchingProtocols = @"SwitchingProtocols"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode TemporaryRedirect = @"TemporaryRedirect"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Unauthorized = @"Unauthorized"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode UnsupportedMediaType = @"UnsupportedMediaType"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode Unused = @"Unused"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode UpgradeRequired = @"UpgradeRequired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode UseProxy = @"UseProxy"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to HttpStatusCode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new HttpStatusCode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type HttpStatusCode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type HttpStatusCode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is HttpStatusCode && Equals((HttpStatusCode)obj); + } + + /// Returns hashCode for enum HttpStatusCode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private HttpStatusCode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for HttpStatusCode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to HttpStatusCode + /// the value to convert to an instance of . + + public static implicit operator HttpStatusCode(string value) + { + return new HttpStatusCode(value); + } + + /// Implicit operator to convert HttpStatusCode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode e) + { + return e._value; + } + + /// Overriding != operator for enum HttpStatusCode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum HttpStatusCode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HttpStatusCode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/IaasvmPolicyType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/IaasvmPolicyType.cs new file mode 100644 index 000000000000..1339f7da81f3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/IaasvmPolicyType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + public partial struct IaasvmPolicyType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType V1 = @"V1"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType V2 = @"V2"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IaasvmPolicyType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IaasvmPolicyType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IaasvmPolicyType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IaasvmPolicyType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is IaasvmPolicyType && Equals((IaasvmPolicyType)obj); + } + + /// Returns hashCode for enum IaasvmPolicyType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private IaasvmPolicyType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IaasvmPolicyType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IaasvmPolicyType + /// the value to convert to an instance of . + + public static implicit operator IaasvmPolicyType(string value) + { + return new IaasvmPolicyType(value); + } + + /// Implicit operator to convert IaasvmPolicyType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType e) + { + return e._value; + } + + /// Overriding != operator for enum IaasvmPolicyType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IaasvmPolicyType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IaasvmPolicyType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/InfrastructureEncryptionState.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/InfrastructureEncryptionState.cs new file mode 100644 index 000000000000..ab33dbb04376 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/InfrastructureEncryptionState.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + public partial struct InfrastructureEncryptionState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState Enabled = @"Enabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState Invalid = @"Invalid"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to InfrastructureEncryptionState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new InfrastructureEncryptionState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type InfrastructureEncryptionState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type InfrastructureEncryptionState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is InfrastructureEncryptionState && Equals((InfrastructureEncryptionState)obj); + } + + /// Returns hashCode for enum InfrastructureEncryptionState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private InfrastructureEncryptionState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for InfrastructureEncryptionState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to InfrastructureEncryptionState + /// the value to convert to an instance of . + + public static implicit operator InfrastructureEncryptionState(string value) + { + return new InfrastructureEncryptionState(value); + } + + /// Implicit operator to convert InfrastructureEncryptionState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState e) + { + return e._value; + } + + /// Overriding != operator for enum InfrastructureEncryptionState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum InfrastructureEncryptionState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InfrastructureEncryptionState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/InquiryStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/InquiryStatus.cs new file mode 100644 index 000000000000..efbc0223f628 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/InquiryStatus.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Status of protectable item, i.e. InProgress,Succeeded,Failed + public partial struct InquiryStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus Success = @"Success"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to InquiryStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new InquiryStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type InquiryStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type InquiryStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is InquiryStatus && Equals((InquiryStatus)obj); + } + + /// Returns hashCode for enum InquiryStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private InquiryStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for InquiryStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to InquiryStatus + /// the value to convert to an instance of . + + public static implicit operator InquiryStatus(string value) + { + return new InquiryStatus(value); + } + + /// Implicit operator to convert InquiryStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus e) + { + return e._value; + } + + /// Overriding != operator for enum InquiryStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum InquiryStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.InquiryStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/IntentItemType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/IntentItemType.cs new file mode 100644 index 000000000000..c8d2503e4cf1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/IntentItemType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of workload this item represents + public partial struct IntentItemType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType SqlAvailabilityGroupContainer = @"SQLAvailabilityGroupContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType SqlInstance = @"SQLInstance"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IntentItemType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IntentItemType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IntentItemType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IntentItemType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is IntentItemType && Equals((IntentItemType)obj); + } + + /// Returns hashCode for enum IntentItemType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private IntentItemType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IntentItemType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IntentItemType + /// the value to convert to an instance of . + + public static implicit operator IntentItemType(string value) + { + return new IntentItemType(value); + } + + /// Implicit operator to convert IntentItemType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType e) + { + return e._value; + } + + /// Overriding != operator for enum IntentItemType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IntentItemType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.IntentItemType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/JobOperationType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/JobOperationType.cs new file mode 100644 index 000000000000..2093b358b762 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/JobOperationType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of operation. + public partial struct JobOperationType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType Backup = @"Backup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType ConfigureBackup = @"ConfigureBackup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType CrossRegionRestore = @"CrossRegionRestore"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType DeleteBackupData = @"DeleteBackupData"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType DisableBackup = @"DisableBackup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType Register = @"Register"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType Restore = @"Restore"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType UnRegister = @"UnRegister"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType Undelete = @"Undelete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType UpdateCustomerManagedKey = @"UpdateCustomerManagedKey"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to JobOperationType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new JobOperationType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type JobOperationType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type JobOperationType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is JobOperationType && Equals((JobOperationType)obj); + } + + /// Returns hashCode for enum JobOperationType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private JobOperationType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for JobOperationType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to JobOperationType + /// the value to convert to an instance of . + + public static implicit operator JobOperationType(string value) + { + return new JobOperationType(value); + } + + /// Implicit operator to convert JobOperationType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType e) + { + return e._value; + } + + /// Overriding != operator for enum JobOperationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum JobOperationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/JobStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/JobStatus.cs new file mode 100644 index 000000000000..d3c613cb78f4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/JobStatus.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Status of the job. + public partial struct JobStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus Cancelled = @"Cancelled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus Cancelling = @"Cancelling"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus CompletedWithWarnings = @"CompletedWithWarnings"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to JobStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new JobStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type JobStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type JobStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is JobStatus && Equals((JobStatus)obj); + } + + /// Returns hashCode for enum JobStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private JobStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for JobStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to JobStatus + /// the value to convert to an instance of . + + public static implicit operator JobStatus(string value) + { + return new JobStatus(value); + } + + /// Implicit operator to convert JobStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus e) + { + return e._value; + } + + /// Overriding != operator for enum JobStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum JobStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/JobSupportedAction.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/JobSupportedAction.cs new file mode 100644 index 000000000000..94fa7e521d24 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/JobSupportedAction.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + public partial struct JobSupportedAction : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction Cancellable = @"Cancellable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction Retriable = @"Retriable"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to JobSupportedAction + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new JobSupportedAction(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type JobSupportedAction + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type JobSupportedAction (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is JobSupportedAction && Equals((JobSupportedAction)obj); + } + + /// Returns hashCode for enum JobSupportedAction + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private JobSupportedAction(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for JobSupportedAction + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to JobSupportedAction + /// the value to convert to an instance of . + + public static implicit operator JobSupportedAction(string value) + { + return new JobSupportedAction(value); + } + + /// Implicit operator to convert JobSupportedAction to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction e) + { + return e._value; + } + + /// Overriding != operator for enum JobSupportedAction + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum JobSupportedAction + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/LastBackupStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/LastBackupStatus.cs new file mode 100644 index 000000000000..95dea00aae37 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/LastBackupStatus.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Last backup operation status. Possible values: Healthy, Unhealthy. + public partial struct LastBackupStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus Healthy = @"Healthy"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus IrPending = @"IRPending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus Unhealthy = @"Unhealthy"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LastBackupStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LastBackupStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LastBackupStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LastBackupStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LastBackupStatus && Equals((LastBackupStatus)obj); + } + + /// Returns hashCode for enum LastBackupStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private LastBackupStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LastBackupStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LastBackupStatus + /// the value to convert to an instance of . + + public static implicit operator LastBackupStatus(string value) + { + return new LastBackupStatus(value); + } + + /// Implicit operator to convert LastBackupStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus e) + { + return e._value; + } + + /// Overriding != operator for enum LastBackupStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LastBackupStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/LastUpdateStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/LastUpdateStatus.cs new file mode 100644 index 000000000000..f40361dd8b9c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/LastUpdateStatus.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + public partial struct LastUpdateStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus FirstInitialization = @"FirstInitialization"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus Initialized = @"Initialized"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus NotEnabled = @"NotEnabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus PartiallyFailed = @"PartiallyFailed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus PartiallySucceeded = @"PartiallySucceeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LastUpdateStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LastUpdateStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LastUpdateStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LastUpdateStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LastUpdateStatus && Equals((LastUpdateStatus)obj); + } + + /// Returns hashCode for enum LastUpdateStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private LastUpdateStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LastUpdateStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LastUpdateStatus + /// the value to convert to an instance of . + + public static implicit operator LastUpdateStatus(string value) + { + return new LastUpdateStatus(value); + } + + /// Implicit operator to convert LastUpdateStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus e) + { + return e._value; + } + + /// Overriding != operator for enum LastUpdateStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LastUpdateStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastUpdateStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/MabServerType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/MabServerType.cs new file mode 100644 index 000000000000..0884638f5729 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/MabServerType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Server type of MAB container. + public partial struct MabServerType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType AzureBackupServerContainer = @"AzureBackupServerContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType AzureSqlContainer = @"AzureSqlContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType Cluster = @"Cluster"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType DpmContainer = @"DPMContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType GenericContainer = @"GenericContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType IaasVMContainer = @"IaasVMContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType IaasVMServiceContainer = @"IaasVMServiceContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType MabContainer = @"MABContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType SqlagWorkLoadContainer = @"SQLAGWorkLoadContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType StorageContainer = @"StorageContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType Unknown = @"Unknown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType VCenter = @"VCenter"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType VMAppContainer = @"VMAppContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType Windows = @"Windows"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MabServerType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MabServerType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MabServerType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MabServerType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MabServerType && Equals((MabServerType)obj); + } + + /// Returns hashCode for enum MabServerType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MabServerType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MabServerType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MabServerType + /// the value to convert to an instance of . + + public static implicit operator MabServerType(string value) + { + return new MabServerType(value); + } + + /// Implicit operator to convert MabServerType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType e) + { + return e._value; + } + + /// Overriding != operator for enum MabServerType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MabServerType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/MonthOfYear.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/MonthOfYear.cs new file mode 100644 index 000000000000..cc6411288e38 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/MonthOfYear.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + public partial struct MonthOfYear : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear April = @"April"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear August = @"August"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear December = @"December"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear February = @"February"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear January = @"January"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear July = @"July"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear June = @"June"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear March = @"March"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear May = @"May"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear November = @"November"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear October = @"October"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear September = @"September"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MonthOfYear + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MonthOfYear(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MonthOfYear + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MonthOfYear (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MonthOfYear && Equals((MonthOfYear)obj); + } + + /// Returns hashCode for enum MonthOfYear + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MonthOfYear(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MonthOfYear + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MonthOfYear + /// the value to convert to an instance of . + + public static implicit operator MonthOfYear(string value) + { + return new MonthOfYear(value); + } + + /// Implicit operator to convert MonthOfYear to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear e) + { + return e._value; + } + + /// Overriding != operator for enum MonthOfYear + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MonthOfYear + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MonthOfYear e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/OperationStatusValues.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/OperationStatusValues.cs new file mode 100644 index 000000000000..54e26f1542f0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/OperationStatusValues.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Operation status. + public partial struct OperationStatusValues : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to OperationStatusValues + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new OperationStatusValues(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type OperationStatusValues + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type OperationStatusValues (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is OperationStatusValues && Equals((OperationStatusValues)obj); + } + + /// Returns hashCode for enum OperationStatusValues + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private OperationStatusValues(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for OperationStatusValues + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to OperationStatusValues + /// the value to convert to an instance of . + + public static implicit operator OperationStatusValues(string value) + { + return new OperationStatusValues(value); + } + + /// Implicit operator to convert OperationStatusValues to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues e) + { + return e._value; + } + + /// Overriding != operator for enum OperationStatusValues + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum OperationStatusValues + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/OperationType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/OperationType.cs new file mode 100644 index 000000000000..98314eb11e32 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/OperationType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Re-Do Operation + public partial struct OperationType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType Register = @"Register"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType Reregister = @"Reregister"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to OperationType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new OperationType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type OperationType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type OperationType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is OperationType && Equals((OperationType)obj); + } + + /// Returns hashCode for enum OperationType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private OperationType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for OperationType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to OperationType + /// the value to convert to an instance of . + + public static implicit operator OperationType(string value) + { + return new OperationType(value); + } + + /// Implicit operator to convert OperationType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType e) + { + return e._value; + } + + /// Overriding != operator for enum OperationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum OperationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/OverwriteOptions.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/OverwriteOptions.cs new file mode 100644 index 000000000000..ad5cd76d860f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/OverwriteOptions.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Can Overwrite if Target DataBase already exists + public partial struct OverwriteOptions : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions FailOnConflict = @"FailOnConflict"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions Overwrite = @"Overwrite"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to OverwriteOptions + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new OverwriteOptions(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type OverwriteOptions + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type OverwriteOptions (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is OverwriteOptions && Equals((OverwriteOptions)obj); + } + + /// Returns hashCode for enum OverwriteOptions + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private OverwriteOptions(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for OverwriteOptions + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to OverwriteOptions + /// the value to convert to an instance of . + + public static implicit operator OverwriteOptions(string value) + { + return new OverwriteOptions(value); + } + + /// Implicit operator to convert OverwriteOptions to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions e) + { + return e._value; + } + + /// Overriding != operator for enum OverwriteOptions + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum OverwriteOptions + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/PolicyType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/PolicyType.cs new file mode 100644 index 000000000000..a71717d99e10 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/PolicyType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of backup policy type + public partial struct PolicyType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType CopyOnlyFull = @"CopyOnlyFull"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType Differential = @"Differential"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType Full = @"Full"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType Incremental = @"Incremental"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType Log = @"Log"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PolicyType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PolicyType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PolicyType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PolicyType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PolicyType && Equals((PolicyType)obj); + } + + /// Returns hashCode for enum PolicyType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private PolicyType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PolicyType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PolicyType + /// the value to convert to an instance of . + + public static implicit operator PolicyType(string value) + { + return new PolicyType(value); + } + + /// Implicit operator to convert PolicyType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType e) + { + return e._value; + } + + /// Overriding != operator for enum PolicyType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PolicyType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PolicyType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/PrivateEndpointConnectionStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/PrivateEndpointConnectionStatus.cs new file mode 100644 index 000000000000..a4605ec86c99 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/PrivateEndpointConnectionStatus.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Gets or sets the status + public partial struct PrivateEndpointConnectionStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus Approved = @"Approved"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus Disconnected = @"Disconnected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus Pending = @"Pending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus Rejected = @"Rejected"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PrivateEndpointConnectionStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PrivateEndpointConnectionStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PrivateEndpointConnectionStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PrivateEndpointConnectionStatus (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PrivateEndpointConnectionStatus && Equals((PrivateEndpointConnectionStatus)obj); + } + + /// Returns hashCode for enum PrivateEndpointConnectionStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private PrivateEndpointConnectionStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PrivateEndpointConnectionStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PrivateEndpointConnectionStatus + /// the value to convert to an instance of . + + public static implicit operator PrivateEndpointConnectionStatus(string value) + { + return new PrivateEndpointConnectionStatus(value); + } + + /// Implicit operator to convert PrivateEndpointConnectionStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus e) + { + return e._value; + } + + /// Overriding != operator for enum PrivateEndpointConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PrivateEndpointConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.PrivateEndpointConnectionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectedItemHealthStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectedItemHealthStatus.cs new file mode 100644 index 000000000000..7ccfb6d330e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectedItemHealthStatus.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Health status of the backup item, evaluated based on last heartbeat received + public partial struct ProtectedItemHealthStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus Healthy = @"Healthy"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus IrPending = @"IRPending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus NotReachable = @"NotReachable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus Unhealthy = @"Unhealthy"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProtectedItemHealthStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProtectedItemHealthStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProtectedItemHealthStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProtectedItemHealthStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProtectedItemHealthStatus && Equals((ProtectedItemHealthStatus)obj); + } + + /// Returns hashCode for enum ProtectedItemHealthStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ProtectedItemHealthStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProtectedItemHealthStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProtectedItemHealthStatus + /// the value to convert to an instance of . + + public static implicit operator ProtectedItemHealthStatus(string value) + { + return new ProtectedItemHealthStatus(value); + } + + /// Implicit operator to convert ProtectedItemHealthStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ProtectedItemHealthStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProtectedItemHealthStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectedItemState.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectedItemState.cs new file mode 100644 index 000000000000..b5db15288354 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectedItemState.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Backup state of the backed up item. + public partial struct ProtectedItemState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState IrPending = @"IRPending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState Protected = @"Protected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState ProtectionError = @"ProtectionError"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState ProtectionPaused = @"ProtectionPaused"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState ProtectionStopped = @"ProtectionStopped"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProtectedItemState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProtectedItemState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProtectedItemState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProtectedItemState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProtectedItemState && Equals((ProtectedItemState)obj); + } + + /// Returns hashCode for enum ProtectedItemState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ProtectedItemState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProtectedItemState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProtectedItemState + /// the value to convert to an instance of . + + public static implicit operator ProtectedItemState(string value) + { + return new ProtectedItemState(value); + } + + /// Implicit operator to convert ProtectedItemState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState e) + { + return e._value; + } + + /// Overriding != operator for enum ProtectedItemState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProtectedItemState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionIntentItemType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionIntentItemType.cs new file mode 100644 index 000000000000..96b91e6a2e09 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionIntentItemType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// backup protectionIntent type. + public partial struct ProtectionIntentItemType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType AzureResourceItem = @"AzureResourceItem"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType AzureWorkloadAutoProtectionIntent = @"AzureWorkloadAutoProtectionIntent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType AzureWorkloadContainerAutoProtectionIntent = @"AzureWorkloadContainerAutoProtectionIntent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType AzureWorkloadSqlAutoProtectionIntent = @"AzureWorkloadSQLAutoProtectionIntent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType RecoveryServiceVaultItem = @"RecoveryServiceVaultItem"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProtectionIntentItemType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProtectionIntentItemType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProtectionIntentItemType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProtectionIntentItemType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProtectionIntentItemType && Equals((ProtectionIntentItemType)obj); + } + + /// Returns hashCode for enum ProtectionIntentItemType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ProtectionIntentItemType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProtectionIntentItemType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProtectionIntentItemType + /// the value to convert to an instance of . + + public static implicit operator ProtectionIntentItemType(string value) + { + return new ProtectionIntentItemType(value); + } + + /// Implicit operator to convert ProtectionIntentItemType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType e) + { + return e._value; + } + + /// Overriding != operator for enum ProtectionIntentItemType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProtectionIntentItemType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionIntentItemType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionState.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionState.cs new file mode 100644 index 000000000000..c5ae16b1577d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionState.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Backup state of this backup item. + public partial struct ProtectionState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState IrPending = @"IRPending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState Protected = @"Protected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState ProtectionError = @"ProtectionError"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState ProtectionPaused = @"ProtectionPaused"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState ProtectionStopped = @"ProtectionStopped"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProtectionState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProtectionState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProtectionState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProtectionState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProtectionState && Equals((ProtectionState)obj); + } + + /// Returns hashCode for enum ProtectionState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ProtectionState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProtectionState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProtectionState + /// the value to convert to an instance of . + + public static implicit operator ProtectionState(string value) + { + return new ProtectionState(value); + } + + /// Implicit operator to convert ProtectionState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState e) + { + return e._value; + } + + /// Overriding != operator for enum ProtectionState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProtectionState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionStatus.cs new file mode 100644 index 000000000000..2ff53484eb27 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/ProtectionStatus.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Specifies whether the container is registered or not + public partial struct ProtectionStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus NotProtected = @"NotProtected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus Protected = @"Protected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus Protecting = @"Protecting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus ProtectionFailed = @"ProtectionFailed"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProtectionStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProtectionStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProtectionStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProtectionStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProtectionStatus && Equals((ProtectionStatus)obj); + } + + /// Returns hashCode for enum ProtectionStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ProtectionStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProtectionStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProtectionStatus + /// the value to convert to an instance of . + + public static implicit operator ProtectionStatus(string value) + { + return new ProtectionStatus(value); + } + + /// Implicit operator to convert ProtectionStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ProtectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProtectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/ProvisioningState.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/ProvisioningState.cs new file mode 100644 index 000000000000..59866d20352d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/ProvisioningState.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Gets or sets provisioning state of the private endpoint connection + public partial struct ProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState Pending = @"Pending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProvisioningState && Equals((ProvisioningState)obj); + } + + /// Returns hashCode for enum ProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProvisioningState + /// the value to convert to an instance of . + + public static implicit operator ProvisioningState(string value) + { + return new ProvisioningState(value); + } + + /// Implicit operator to convert ProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum ProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryMode.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryMode.cs new file mode 100644 index 000000000000..541e430ec86e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryMode.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Defines whether the current recovery mode is file restore or database restore + public partial struct RecoveryMode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode FileRecovery = @"FileRecovery"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode WorkloadRecovery = @"WorkloadRecovery"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RecoveryMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RecoveryMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RecoveryMode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RecoveryMode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RecoveryMode && Equals((RecoveryMode)obj); + } + + /// Returns hashCode for enum RecoveryMode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RecoveryMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RecoveryMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RecoveryMode + /// the value to convert to an instance of . + + public static implicit operator RecoveryMode(string value) + { + return new RecoveryMode(value); + } + + /// Implicit operator to convert RecoveryMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode e) + { + return e._value; + } + + /// Overriding != operator for enum RecoveryMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RecoveryMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryPointTierStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryPointTierStatus.cs new file mode 100644 index 000000000000..945db7e4b2e6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryPointTierStatus.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Recovery point tier status. + public partial struct RecoveryPointTierStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus Deleted = @"Deleted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus Rehydrated = @"Rehydrated"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus Valid = @"Valid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RecoveryPointTierStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RecoveryPointTierStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RecoveryPointTierStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RecoveryPointTierStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RecoveryPointTierStatus && Equals((RecoveryPointTierStatus)obj); + } + + /// Returns hashCode for enum RecoveryPointTierStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RecoveryPointTierStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RecoveryPointTierStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RecoveryPointTierStatus + /// the value to convert to an instance of . + + public static implicit operator RecoveryPointTierStatus(string value) + { + return new RecoveryPointTierStatus(value); + } + + /// Implicit operator to convert RecoveryPointTierStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus e) + { + return e._value; + } + + /// Overriding != operator for enum RecoveryPointTierStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RecoveryPointTierStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryPointTierType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryPointTierType.cs new file mode 100644 index 000000000000..e75f2efc3be4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryPointTierType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Recovery point tier type. + public partial struct RecoveryPointTierType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType ArchivedRp = @"ArchivedRP"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType HardenedRp = @"HardenedRP"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType InstantRp = @"InstantRP"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RecoveryPointTierType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RecoveryPointTierType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RecoveryPointTierType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RecoveryPointTierType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RecoveryPointTierType && Equals((RecoveryPointTierType)obj); + } + + /// Returns hashCode for enum RecoveryPointTierType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RecoveryPointTierType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RecoveryPointTierType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RecoveryPointTierType + /// the value to convert to an instance of . + + public static implicit operator RecoveryPointTierType(string value) + { + return new RecoveryPointTierType(value); + } + + /// Implicit operator to convert RecoveryPointTierType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType e) + { + return e._value; + } + + /// Overriding != operator for enum RecoveryPointTierType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RecoveryPointTierType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryType.cs new file mode 100644 index 000000000000..acca6fea4cbe --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/RecoveryType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of this recovery. + public partial struct RecoveryType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType AlternateLocation = @"AlternateLocation"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType Offline = @"Offline"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType OriginalLocation = @"OriginalLocation"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType RestoreDisks = @"RestoreDisks"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RecoveryType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RecoveryType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RecoveryType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RecoveryType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RecoveryType && Equals((RecoveryType)obj); + } + + /// Returns hashCode for enum RecoveryType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RecoveryType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RecoveryType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RecoveryType + /// the value to convert to an instance of . + + public static implicit operator RecoveryType(string value) + { + return new RecoveryType(value); + } + + /// Implicit operator to convert RecoveryType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType e) + { + return e._value; + } + + /// Overriding != operator for enum RecoveryType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RecoveryType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/RehydrationPriority.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/RehydrationPriority.cs new file mode 100644 index 000000000000..f11ef72c414d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/RehydrationPriority.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Rehydration Priority + public partial struct RehydrationPriority : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority High = @"High"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority Standard = @"Standard"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RehydrationPriority + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RehydrationPriority(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RehydrationPriority + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RehydrationPriority (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RehydrationPriority && Equals((RehydrationPriority)obj); + } + + /// Returns hashCode for enum RehydrationPriority + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RehydrationPriority(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RehydrationPriority + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RehydrationPriority + /// the value to convert to an instance of . + + public static implicit operator RehydrationPriority(string value) + { + return new RehydrationPriority(value); + } + + /// Implicit operator to convert RehydrationPriority to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority e) + { + return e._value; + } + + /// Overriding != operator for enum RehydrationPriority + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RehydrationPriority + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RehydrationPriority e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/ResourceHealthStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/ResourceHealthStatus.cs new file mode 100644 index 000000000000..e8c98a514434 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/ResourceHealthStatus.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Resource Health Status + public partial struct ResourceHealthStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus Healthy = @"Healthy"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus PersistentDegraded = @"PersistentDegraded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus PersistentUnhealthy = @"PersistentUnhealthy"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus TransientDegraded = @"TransientDegraded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus TransientUnhealthy = @"TransientUnhealthy"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceHealthStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceHealthStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceHealthStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ResourceHealthStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ResourceHealthStatus && Equals((ResourceHealthStatus)obj); + } + + /// Returns hashCode for enum ResourceHealthStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ResourceHealthStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceHealthStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceHealthStatus + /// the value to convert to an instance of . + + public static implicit operator ResourceHealthStatus(string value) + { + return new ResourceHealthStatus(value); + } + + /// Implicit operator to convert ResourceHealthStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceHealthStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceHealthStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/RestorePointQueryType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/RestorePointQueryType.cs new file mode 100644 index 000000000000..001f5016ee1e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/RestorePointQueryType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// RestorePoint type + public partial struct RestorePointQueryType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType All = @"All"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType Differential = @"Differential"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType Full = @"Full"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType FullAndDifferential = @"FullAndDifferential"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType Incremental = @"Incremental"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType Log = @"Log"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RestorePointQueryType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RestorePointQueryType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RestorePointQueryType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RestorePointQueryType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RestorePointQueryType && Equals((RestorePointQueryType)obj); + } + + /// Returns hashCode for enum RestorePointQueryType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RestorePointQueryType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RestorePointQueryType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RestorePointQueryType + /// the value to convert to an instance of . + + public static implicit operator RestorePointQueryType(string value) + { + return new RestorePointQueryType(value); + } + + /// Implicit operator to convert RestorePointQueryType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType e) + { + return e._value; + } + + /// Overriding != operator for enum RestorePointQueryType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RestorePointQueryType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/RestorePointType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/RestorePointType.cs new file mode 100644 index 000000000000..559d782b7f69 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/RestorePointType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of restore point + public partial struct RestorePointType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType Differential = @"Differential"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType Full = @"Full"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType Incremental = @"Incremental"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType Log = @"Log"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RestorePointType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RestorePointType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RestorePointType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RestorePointType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RestorePointType && Equals((RestorePointType)obj); + } + + /// Returns hashCode for enum RestorePointType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RestorePointType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RestorePointType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RestorePointType + /// the value to convert to an instance of . + + public static implicit operator RestorePointType(string value) + { + return new RestorePointType(value); + } + + /// Implicit operator to convert RestorePointType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType e) + { + return e._value; + } + + /// Overriding != operator for enum RestorePointType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RestorePointType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/RestoreRequestType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/RestoreRequestType.cs new file mode 100644 index 000000000000..51460bf5c9db --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/RestoreRequestType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Restore Type (FullShareRestore or ItemLevelRestore) + public partial struct RestoreRequestType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType FullShareRestore = @"FullShareRestore"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType ItemLevelRestore = @"ItemLevelRestore"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RestoreRequestType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RestoreRequestType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RestoreRequestType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RestoreRequestType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RestoreRequestType && Equals((RestoreRequestType)obj); + } + + /// Returns hashCode for enum RestoreRequestType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RestoreRequestType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RestoreRequestType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RestoreRequestType + /// the value to convert to an instance of . + + public static implicit operator RestoreRequestType(string value) + { + return new RestoreRequestType(value); + } + + /// Implicit operator to convert RestoreRequestType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType e) + { + return e._value; + } + + /// Overriding != operator for enum RestoreRequestType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RestoreRequestType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/RetentionDurationType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/RetentionDurationType.cs new file mode 100644 index 000000000000..116a8957d2a5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/RetentionDurationType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Retention duration type of retention policy. + public partial struct RetentionDurationType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType Days = @"Days"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType Months = @"Months"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType Weeks = @"Weeks"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType Years = @"Years"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RetentionDurationType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RetentionDurationType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RetentionDurationType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RetentionDurationType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RetentionDurationType && Equals((RetentionDurationType)obj); + } + + /// Returns hashCode for enum RetentionDurationType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RetentionDurationType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RetentionDurationType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RetentionDurationType + /// the value to convert to an instance of . + + public static implicit operator RetentionDurationType(string value) + { + return new RetentionDurationType(value); + } + + /// Implicit operator to convert RetentionDurationType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType e) + { + return e._value; + } + + /// Overriding != operator for enum RetentionDurationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RetentionDurationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionDurationType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/RetentionScheduleFormat.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/RetentionScheduleFormat.cs new file mode 100644 index 000000000000..6205b5ee08d4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/RetentionScheduleFormat.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Retention schedule format type for monthly retention policy. + public partial struct RetentionScheduleFormat : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat Daily = @"Daily"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat Weekly = @"Weekly"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RetentionScheduleFormat + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RetentionScheduleFormat(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RetentionScheduleFormat + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RetentionScheduleFormat (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RetentionScheduleFormat && Equals((RetentionScheduleFormat)obj); + } + + /// Returns hashCode for enum RetentionScheduleFormat + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RetentionScheduleFormat(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RetentionScheduleFormat + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RetentionScheduleFormat + /// the value to convert to an instance of . + + public static implicit operator RetentionScheduleFormat(string value) + { + return new RetentionScheduleFormat(value); + } + + /// Implicit operator to convert RetentionScheduleFormat to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat e) + { + return e._value; + } + + /// Overriding != operator for enum RetentionScheduleFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RetentionScheduleFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RetentionScheduleFormat e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/ScheduleRunType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/ScheduleRunType.cs new file mode 100644 index 000000000000..018a78a1872a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/ScheduleRunType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Frequency of the schedule operation of this policy. + public partial struct ScheduleRunType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType Daily = @"Daily"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType Hourly = @"Hourly"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType Weekly = @"Weekly"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ScheduleRunType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ScheduleRunType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ScheduleRunType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ScheduleRunType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ScheduleRunType && Equals((ScheduleRunType)obj); + } + + /// Returns hashCode for enum ScheduleRunType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ScheduleRunType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ScheduleRunType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ScheduleRunType + /// the value to convert to an instance of . + + public static implicit operator ScheduleRunType(string value) + { + return new ScheduleRunType(value); + } + + /// Implicit operator to convert ScheduleRunType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType e) + { + return e._value; + } + + /// Overriding != operator for enum ScheduleRunType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ScheduleRunType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ScheduleRunType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/SoftDeleteFeatureState.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/SoftDeleteFeatureState.cs new file mode 100644 index 000000000000..8f6d6cf3b0ea --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/SoftDeleteFeatureState.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Soft Delete feature state + public partial struct SoftDeleteFeatureState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState Enabled = @"Enabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SoftDeleteFeatureState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SoftDeleteFeatureState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SoftDeleteFeatureState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SoftDeleteFeatureState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SoftDeleteFeatureState && Equals((SoftDeleteFeatureState)obj); + } + + /// Returns hashCode for enum SoftDeleteFeatureState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SoftDeleteFeatureState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SoftDeleteFeatureState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SoftDeleteFeatureState + /// the value to convert to an instance of . + + public static implicit operator SoftDeleteFeatureState(string value) + { + return new SoftDeleteFeatureState(value); + } + + /// Implicit operator to convert SoftDeleteFeatureState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState e) + { + return e._value; + } + + /// Overriding != operator for enum SoftDeleteFeatureState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SoftDeleteFeatureState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SoftDeleteFeatureState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/SqlDataDirectoryType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/SqlDataDirectoryType.cs new file mode 100644 index 000000000000..da3f3e18577f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/SqlDataDirectoryType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of data directory mapping + public partial struct SqlDataDirectoryType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType Data = @"Data"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType Log = @"Log"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SqlDataDirectoryType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SqlDataDirectoryType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SqlDataDirectoryType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SqlDataDirectoryType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SqlDataDirectoryType && Equals((SqlDataDirectoryType)obj); + } + + /// Returns hashCode for enum SqlDataDirectoryType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SqlDataDirectoryType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SqlDataDirectoryType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SqlDataDirectoryType + /// the value to convert to an instance of . + + public static implicit operator SqlDataDirectoryType(string value) + { + return new SqlDataDirectoryType(value); + } + + /// Implicit operator to convert SqlDataDirectoryType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType e) + { + return e._value; + } + + /// Overriding != operator for enum SqlDataDirectoryType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SqlDataDirectoryType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/StorageType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/StorageType.cs new file mode 100644 index 000000000000..f54c1bb911fb --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/StorageType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Storage type + public partial struct StorageType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType GeoRedundant = @"GeoRedundant"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType LocallyRedundant = @"LocallyRedundant"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType ReadAccessGeoZoneRedundant = @"ReadAccessGeoZoneRedundant"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType ZoneRedundant = @"ZoneRedundant"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to StorageType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new StorageType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type StorageType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type StorageType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is StorageType && Equals((StorageType)obj); + } + + /// Returns hashCode for enum StorageType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private StorageType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for StorageType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to StorageType + /// the value to convert to an instance of . + + public static implicit operator StorageType(string value) + { + return new StorageType(value); + } + + /// Implicit operator to convert StorageType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType e) + { + return e._value; + } + + /// Overriding != operator for enum StorageType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum StorageType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/StorageTypeState.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/StorageTypeState.cs new file mode 100644 index 000000000000..333b40f08678 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/StorageTypeState.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + public partial struct StorageTypeState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState Locked = @"Locked"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState Unlocked = @"Unlocked"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to StorageTypeState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new StorageTypeState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type StorageTypeState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type StorageTypeState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is StorageTypeState && Equals((StorageTypeState)obj); + } + + /// Returns hashCode for enum StorageTypeState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private StorageTypeState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for StorageTypeState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to StorageTypeState + /// the value to convert to an instance of . + + public static implicit operator StorageTypeState(string value) + { + return new StorageTypeState(value); + } + + /// Implicit operator to convert StorageTypeState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState e) + { + return e._value; + } + + /// Overriding != operator for enum StorageTypeState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum StorageTypeState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/SupportStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/SupportStatus.cs new file mode 100644 index 000000000000..76f9c44a13c4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/SupportStatus.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Support status of feature + public partial struct SupportStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus DefaultOff = @"DefaultOFF"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus DefaultOn = @"DefaultON"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus NotSupported = @"NotSupported"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus Supported = @"Supported"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SupportStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SupportStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SupportStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SupportStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SupportStatus && Equals((SupportStatus)obj); + } + + /// Returns hashCode for enum SupportStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SupportStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SupportStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SupportStatus + /// the value to convert to an instance of . + + public static implicit operator SupportStatus(string value) + { + return new SupportStatus(value); + } + + /// Implicit operator to convert SupportStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus e) + { + return e._value; + } + + /// Overriding != operator for enum SupportStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SupportStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SupportStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/TieringMode.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/TieringMode.cs new file mode 100644 index 000000000000..dd5c3bdb40bb --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/TieringMode.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// + /// Tiering Mode to control automatic tiering of recovery points. Supported values are: + /// 1. TierRecommended: Tier all recovery points recommended to be tiered + /// 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. + /// 3. DoNotTier: Do not tier any recovery points + /// + public partial struct TieringMode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode DoNotTier = @"DoNotTier"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode TierAfter = @"TierAfter"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode TierRecommended = @"TierRecommended"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TieringMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TieringMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TieringMode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TieringMode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is TieringMode && Equals((TieringMode)obj); + } + + /// Returns hashCode for enum TieringMode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private TieringMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for TieringMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to TieringMode + /// the value to convert to an instance of . + + public static implicit operator TieringMode(string value) + { + return new TieringMode(value); + } + + /// Implicit operator to convert TieringMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode e) + { + return e._value; + } + + /// Overriding != operator for enum TieringMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TieringMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TieringMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/Type.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/Type.cs new file mode 100644 index 000000000000..28ac09ac77e5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/Type.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Backup management type for this container. + public partial struct Type : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type BackupProtectedItemCountSummary = @"BackupProtectedItemCountSummary"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type BackupProtectionContainerCountSummary = @"BackupProtectionContainerCountSummary"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Type + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Type(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Type + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Type (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Type && Equals((Type)obj); + } + + /// Returns hashCode for enum Type + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Type + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private Type(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to Type + /// the value to convert to an instance of . + + public static implicit operator Type(string value) + { + return new Type(value); + } + + /// Implicit operator to convert Type to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type e) + { + return e._value; + } + + /// Overriding != operator for enum Type + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Type + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/UsagesUnit.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/UsagesUnit.cs new file mode 100644 index 000000000000..98b50b2d92c9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/UsagesUnit.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Unit of the usage. + public partial struct UsagesUnit : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit Bytes = @"Bytes"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit BytesPerSecond = @"BytesPerSecond"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit Count = @"Count"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit CountPerSecond = @"CountPerSecond"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit Percent = @"Percent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit Seconds = @"Seconds"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UsagesUnit + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UsagesUnit(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UsagesUnit + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UsagesUnit (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is UsagesUnit && Equals((UsagesUnit)obj); + } + + /// Returns hashCode for enum UsagesUnit + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UsagesUnit + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private UsagesUnit(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UsagesUnit + /// the value to convert to an instance of . + + public static implicit operator UsagesUnit(string value) + { + return new UsagesUnit(value); + } + + /// Implicit operator to convert UsagesUnit to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit e) + { + return e._value; + } + + /// Overriding != operator for enum UsagesUnit + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UsagesUnit + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/ValidationStatus.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/ValidationStatus.cs new file mode 100644 index 000000000000..8fcb0b897bc7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/ValidationStatus.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Validation Status + public partial struct ValidationStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ValidationStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ValidationStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ValidationStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ValidationStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ValidationStatus && Equals((ValidationStatus)obj); + } + + /// Returns hashCode for enum ValidationStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ValidationStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private ValidationStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to ValidationStatus + /// the value to convert to an instance of . + + public static implicit operator ValidationStatus(string value) + { + return new ValidationStatus(value); + } + + /// Implicit operator to convert ValidationStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ValidationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ValidationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ValidationStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/WeekOfMonth.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/WeekOfMonth.cs new file mode 100644 index 000000000000..47575c06851a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/WeekOfMonth.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + public partial struct WeekOfMonth : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth First = @"First"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth Fourth = @"Fourth"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth Last = @"Last"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth Second = @"Second"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth Third = @"Third"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to WeekOfMonth + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new WeekOfMonth(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type WeekOfMonth + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type WeekOfMonth (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is WeekOfMonth && Equals((WeekOfMonth)obj); + } + + /// Returns hashCode for enum WeekOfMonth + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for WeekOfMonth + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private WeekOfMonth(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to WeekOfMonth + /// the value to convert to an instance of . + + public static implicit operator WeekOfMonth(string value) + { + return new WeekOfMonth(value); + } + + /// Implicit operator to convert WeekOfMonth to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth e) + { + return e._value; + } + + /// Overriding != operator for enum WeekOfMonth + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum WeekOfMonth + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WeekOfMonth e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/WorkloadItemType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/WorkloadItemType.cs new file mode 100644 index 000000000000..284fb3348731 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/WorkloadItemType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Workload item type of the item for which intent is to be set + public partial struct WorkloadItemType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType SapAseDatabase = @"SAPAseDatabase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType SapAseSystem = @"SAPAseSystem"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType SapHanaDatabase = @"SAPHanaDatabase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType SapHanaSystem = @"SAPHanaSystem"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType SqlDataBase = @"SQLDataBase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType SqlInstance = @"SQLInstance"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to WorkloadItemType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new WorkloadItemType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type WorkloadItemType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type WorkloadItemType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is WorkloadItemType && Equals((WorkloadItemType)obj); + } + + /// Returns hashCode for enum WorkloadItemType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for WorkloadItemType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private WorkloadItemType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to WorkloadItemType + /// the value to convert to an instance of . + + public static implicit operator WorkloadItemType(string value) + { + return new WorkloadItemType(value); + } + + /// Implicit operator to convert WorkloadItemType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType e) + { + return e._value; + } + + /// Overriding != operator for enum WorkloadItemType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum WorkloadItemType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadItemType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/WorkloadType.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/WorkloadType.cs new file mode 100644 index 000000000000..6d84020be324 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/WorkloadType.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.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Type of workload for the backup management + public partial struct WorkloadType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType AzureFileShare = @"AzureFileShare"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType AzureSqlDb = @"AzureSqlDb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType Client = @"Client"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType Exchange = @"Exchange"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType FileFolder = @"FileFolder"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType GenericDataSource = @"GenericDataSource"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType SapAseDatabase = @"SAPAseDatabase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType SapHanaDatabase = @"SAPHanaDatabase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType Sharepoint = @"Sharepoint"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType SqlDataBase = @"SQLDataBase"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType Sqldb = @"SQLDB"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType SystemState = @"SystemState"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType VM = @"VM"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType VMwareVM = @"VMwareVM"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to WorkloadType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new WorkloadType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type WorkloadType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type WorkloadType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is WorkloadType && Equals((WorkloadType)obj); + } + + /// Returns hashCode for enum WorkloadType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for WorkloadType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private WorkloadType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to WorkloadType + /// the value to convert to an instance of . + + public static implicit operator WorkloadType(string value) + { + return new WorkloadType(value); + } + + /// Implicit operator to convert WorkloadType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType e) + { + return e._value; + } + + /// Overriding != operator for enum WorkloadType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum WorkloadType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/api/Support/XcoolState.cs b/swaggerci/recoveryservicesbackup/generated/api/Support/XcoolState.cs new file mode 100644 index 000000000000..265b307cf5e3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/api/Support/XcoolState.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Vault x-cool state + public partial struct XcoolState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState Enabled = @"Enabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to XcoolState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new XcoolState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type XcoolState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type XcoolState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is XcoolState && Equals((XcoolState)obj); + } + + /// Returns hashCode for enum XcoolState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for XcoolState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private XcoolState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to XcoolState + /// the value to convert to an instance of . + + public static implicit operator XcoolState(string value) + { + return new XcoolState(value); + } + + /// Implicit operator to convert XcoolState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState e) + { + return e._value; + } + + /// Overriding != operator for enum XcoolState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum XcoolState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState e1, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.XcoolState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/CmdInfoHandler.cs b/swaggerci/recoveryservicesbackup/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..02b31b3a58ff --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/CmdInfoHandler.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Management.Automation; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using NextDelegate = Func, Task>, Task>; + using SignalDelegate = Func, Task>; + + public class CmdInfoHandler + { + private readonly string processRecordId; + private readonly string parameterSetName; + private readonly InvocationInfo invocationInfo; + + public CmdInfoHandler(string processRecordId, InvocationInfo invocationInfo, string parameterSetName) + { + this.processRecordId = processRecordId; + this.parameterSetName = parameterSetName; + this.invocationInfo = invocationInfo; + } + + public Task SendAsync(HttpRequestMessage request, CancellationToken token, Action cancel, SignalDelegate signal, NextDelegate next) + { + request.Headers.Add("x-ms-client-request-id", processRecordId); + request.Headers.Add("CommandName", invocationInfo?.InvocationName); + request.Headers.Add("FullCommandName", invocationInfo?.MyCommand?.Name); + request.Headers.Add("ParameterSetName", parameterSetName); + + // continue with pipeline. + return next(request, token, cancel, signal); + } + } +} diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/ConversionException.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..601dfc68aa85 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/ConversionException.cs @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal class ConversionException : Exception + { + internal ConversionException(string message) + : base(message) { } + + internal ConversionException(JsonNode node, Type targetType) + : base($"Cannot convert '{node.Type}' to a {targetType.Name}") { } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..88370cf81802 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/IJsonConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal interface IJsonConverter + { + JsonNode ToJson(object value); + + object FromJson(JsonNode node); + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..85b0bfbf80f2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/BinaryConverter.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. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class BinaryConverter : JsonConverter + { + internal override JsonNode ToJson(byte[] value) => new XBinary(value); + + internal override byte[] FromJson(JsonNode node) + { + switch (node.Type) + { + case JsonType.String : return Convert.FromBase64String(node.ToString()); // Base64 Encoded + case JsonType.Binary : return ((XBinary)node).Value; + } + + throw new ConversionException(node, typeof(byte[])); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..3f032481a9aa --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/BooleanConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class BooleanConverter : JsonConverter + { + internal override JsonNode ToJson(bool value) => new JsonBoolean(value); + + internal override bool FromJson(JsonNode node) => (bool)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..1ab45d89dcb8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DateTimeConverter.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class DateTimeConverter : JsonConverter + { + internal override JsonNode ToJson(DateTime value) + { + return new JsonDate(value); + } + + internal override DateTime FromJson(JsonNode node) => (DateTime)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..032472c7f94b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class DateTimeOffsetConverter : JsonConverter + { + internal override JsonNode ToJson(DateTimeOffset value) => new JsonDate(value); + + internal override DateTimeOffset FromJson(JsonNode node) => (DateTimeOffset)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..558bdb42d287 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DecimalConverter.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class DecimalConverter : JsonConverter + { + internal override JsonNode ToJson(decimal value) => new JsonNumber(value.ToString()); + + internal override decimal FromJson(JsonNode node) + { + return (decimal)node; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..32f1bcb4a1b5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/DoubleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class DoubleConverter : JsonConverter + { + internal override JsonNode ToJson(double value) => new JsonNumber(value); + + internal override double FromJson(JsonNode node) => (double)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..c9d9a8878b39 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/EnumConverter.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class EnumConverter : IJsonConverter + { + private readonly Type type; + + internal EnumConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + } + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + + public object FromJson(JsonNode node) + { + if (node.Type == JsonType.Number) + { + return Enum.ToObject(type, (int)node); + } + + return Enum.Parse(type, node.ToString(), ignoreCase: true); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..1e47b9452374 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/GuidConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class GuidConverter : JsonConverter + { + internal override JsonNode ToJson(Guid value) => new JsonString(value.ToString()); + + internal override Guid FromJson(JsonNode node) => (Guid)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..c3f6e32c2eca --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/HashSet'1Converter.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. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class HashSetConverter : JsonConverter> + { + internal override JsonNode ToJson(HashSet value) + { + return new XSet(value); + } + + internal override HashSet FromJson(JsonNode node) + { + var collection = node as ICollection; + + if (collection.Count == 0) return null; + + // TODO: Remove Linq depedency + return new HashSet(collection.Cast()); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..9a139aa93872 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class Int16Converter : JsonConverter + { + internal override JsonNode ToJson(short value) => new JsonNumber(value); + + internal override short FromJson(JsonNode node) => (short)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..c4889d343f16 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class Int32Converter : JsonConverter + { + internal override JsonNode ToJson(int value) => new JsonNumber(value); + + internal override int FromJson(JsonNode node) => (int)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..23558742dc15 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/Int64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class Int64Converter : JsonConverter + { + internal override JsonNode ToJson(long value) => new JsonNumber(value); + + internal override long FromJson(JsonNode node) => (long)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..e05c0daf2823 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/JsonArrayConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class JsonArrayConverter : JsonConverter + { + internal override JsonNode ToJson(JsonArray value) => value; + + internal override JsonArray FromJson(JsonNode node) => (JsonArray)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..7dd9c0364c1f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/JsonObjectConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class JsonObjectConverter : JsonConverter + { + internal override JsonNode ToJson(JsonObject value) => value; + + internal override JsonObject FromJson(JsonNode node) => (JsonObject)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..905bababf0d0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/SingleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class SingleConverter : JsonConverter + { + internal override JsonNode ToJson(float value) => new JsonNumber(value.ToString()); + + internal override float FromJson(JsonNode node) => (float)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..f135dd36ed65 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/StringConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class StringConverter : JsonConverter + { + internal override JsonNode ToJson(string value) => new JsonString(value); + + internal override string FromJson(JsonNode node) => node.ToString(); + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..a306d14ebc34 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/TimeSpanConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class TimeSpanConverter : JsonConverter + { + internal override JsonNode ToJson(TimeSpan value) => new JsonString(value.ToString()); + + internal override TimeSpan FromJson(JsonNode node) => (TimeSpan)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..3f9ca1ff7851 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class UInt16Converter : JsonConverter + { + internal override JsonNode ToJson(ushort value) => new JsonNumber(value); + + internal override ushort FromJson(JsonNode node) => (ushort)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..eb534d9072ff --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class UInt32Converter : JsonConverter + { + internal override JsonNode ToJson(uint value) => new JsonNumber(value); + + internal override uint FromJson(JsonNode node) => (uint)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..51e887291522 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UInt64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class UInt64Converter : JsonConverter + { + internal override JsonNode ToJson(ulong value) => new JsonNumber(value.ToString()); + + internal override ulong FromJson(JsonNode node) => (ulong)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..5f7070b01625 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/Instances/UriConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class UriConverter : JsonConverter + { + internal override JsonNode ToJson(Uri value) => new JsonString(value.AbsoluteUri); + + internal override Uri FromJson(JsonNode node) => (Uri)node; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..5c4e0f41d6b5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverter.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public abstract class JsonConverter : IJsonConverter + { + internal abstract T FromJson(JsonNode node); + + internal abstract JsonNode ToJson(T value); + + #region IConverter + + object IJsonConverter.FromJson(JsonNode node) => FromJson(node); + + JsonNode IJsonConverter.ToJson(object value) => ToJson((T)value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..c355ba95e87d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverterAttribute.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class JsonConverterAttribute : Attribute + { + internal JsonConverterAttribute(Type type) + { + Converter = (IJsonConverter)Activator.CreateInstance(type); + } + + internal IJsonConverter Converter { get; } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..10c850fdfae0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/JsonConverterFactory.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class JsonConverterFactory + { + private static readonly Dictionary converters = new Dictionary(); + + static JsonConverterFactory() + { + AddInternal(new BooleanConverter()); + AddInternal(new DateTimeConverter()); + AddInternal(new DateTimeOffsetConverter()); + AddInternal(new BinaryConverter()); + AddInternal(new DecimalConverter()); + AddInternal(new DoubleConverter()); + AddInternal(new GuidConverter()); + AddInternal(new Int16Converter()); + AddInternal(new Int32Converter()); + AddInternal(new Int64Converter()); + AddInternal(new SingleConverter()); + AddInternal(new StringConverter()); + AddInternal(new TimeSpanConverter()); + AddInternal(new UInt16Converter()); + AddInternal(new UInt32Converter()); + AddInternal(new UInt64Converter()); + AddInternal(new UriConverter()); + + // Hash sets + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + + // JSON + + AddInternal(new JsonObjectConverter()); + AddInternal(new JsonArrayConverter()); + } + + internal static Dictionary Instances => converters; + + internal static IJsonConverter Get(Type type) + { + var details = TypeDetails.Get(type); + + if (details.JsonConverter == null) + { + throw new ConversionException($"No converter found for '{type.Name}'."); + } + + return details.JsonConverter; + } + + internal static bool TryGet(Type type, out IJsonConverter converter) + { + var typeDetails = TypeDetails.Get(type); + + converter = typeDetails.JsonConverter; + + return converter != null; + } + + private static void AddInternal(JsonConverter converter) + => converters.Add(typeof(T), converter); + + private static void AddInternal(IJsonConverter converter) + => converters.Add(typeof(T), converter); + + internal static void Add(JsonConverter converter) + { + if (converter == null) + { + throw new ArgumentNullException(nameof(converter)); + } + + AddInternal(converter); + + var type = TypeDetails.Get(); + + type.JsonConverter = converter; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..bf01338ebc67 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Conversions/StringLikeConverter.cs @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class StringLikeConverter : IJsonConverter + { + private readonly Type type; + private readonly MethodInfo parseMethod; + + internal StringLikeConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + this.parseMethod = StringLikeHelper.GetParseMethod(type); + } + + public object FromJson(JsonNode node) => + parseMethod.Invoke(null, new[] { node.ToString() }); + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + } + + internal static class StringLikeHelper + { + private static readonly Type[] parseMethodParamaterTypes = new[] { typeof(string) }; + + internal static bool IsStringLike(Type type) + { + return GetParseMethod(type) != null; + } + + internal static MethodInfo GetParseMethod(Type type) + { + MethodInfo method = type.GetMethod("Parse", parseMethodParamaterTypes); + + if (method?.IsPublic != true) return null; + + return method; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..1ac6fe59e880 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/IJsonSerializable.cs @@ -0,0 +1,263 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + public interface IJsonSerializable + { + JsonNode ToJson(JsonObject container = null, SerializationMode serializationMode = SerializationMode.None); + } + internal static class JsonSerializable + { + /// + /// Serializes an enumerable and returns a JsonNode. + /// + /// an IEnumerable collection of items + /// A JsonNode that contains the collection of items serialized. + private static JsonNode ToJsonValue(System.Collections.IEnumerable enumerable) + { + if (enumerable != null) + { + // is it a byte array of some kind? + if (enumerable is System.Collections.Generic.IEnumerable byteEnumerable) + { + return new XBinary(System.Linq.Enumerable.ToArray(byteEnumerable)); + } + + var hasValues = false; + // just create an array of value nodes. + var result = new XNodeArray(); + foreach (var each in enumerable) + { + // we had at least one value. + hasValues = true; + + // try to serialize it. + var node = ToJsonValue(each); + if (null != node) + { + result.Add(node); + } + } + + // if we were able to add values, (or it was just empty), return it. + if (result.Count > 0 || !hasValues) + { + return result; + } + } + + // we couldn't serialize the values. Sorry. + return null; + } + + /// + /// Serializes a valuetype to a JsonNode. + /// + /// a ValueType (ie, a primitive, enum or struct) to be serialized + /// a JsonNode with the serialized value + private static JsonNode ToJsonValue(ValueType vValue) + { + // numeric type + if (vValue is SByte || vValue is Int16 || vValue is Int32 || vValue is Int64 || vValue is Byte || vValue is UInt16 || vValue is UInt32 || vValue is UInt64 || vValue is decimal || vValue is float || vValue is double) + { + return new JsonNumber(vValue.ToString()); + } + + // boolean type + if (vValue is bool bValue) + { + return new JsonBoolean(bValue); + } + + // dates + if (vValue is DateTime dtValue) + { + return new JsonDate(dtValue); + } + + // DictionaryEntity struct type + if (vValue is System.Collections.DictionaryEntry deValue) + { + return new JsonObject { { deValue.Key.ToString(), ToJsonValue(deValue.Value) } }; + } + + // sorry, no idea. + return null; + } + /// + /// Attempts to serialize an object by using ToJson() or ToJsonString() if they exist. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + private static JsonNode TryToJsonValue(dynamic oValue) + { + object jsonValue = null; + dynamic v = oValue; + try + { + jsonValue = v.ToJson().ToString(); + } + catch + { + // no harm... + try + { + jsonValue = v.ToJsonString().ToString(); + } + catch + { + // no worries here either. + } + } + + // if we got something out, let's use it. + if (null != jsonValue) + { + // JsonNumber is really a literal json value. Just don't try to cast that back to an actual number, ok? + return new JsonNumber(jsonValue.ToString()); + } + + return null; + } + + /// + /// Serialize an object by using a variety of methods. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + internal static JsonNode ToJsonValue(object value) + { + // things that implement our interface are preferred. + if (value is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable jsonSerializable) + { + return jsonSerializable.ToJson(); + } + + // strings are easy. + if (value is string || value is char) + { + return new JsonString(value.ToString()); + } + + // value types are fairly straightforward (fallback to ToJson()/ToJsonString() or literal JsonString ) + if (value is System.ValueType vValue) + { + return ToJsonValue(vValue) ?? TryToJsonValue(vValue) ?? new JsonString(vValue.ToString()); + } + + // dictionaries are objects that should be able to serialize + if (value is System.Collections.Generic.IDictionary dictionary) + { + return Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson(dictionary, null); + } + + // hashtables are converted to dictionaries for serialization + if (value is System.Collections.Hashtable hashtable) + { + var dict = new System.Collections.Generic.Dictionary(); + DictionaryExtensions.HashTableToDictionary(hashtable, dict); + return Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.ToJson(dict, null); + } + + // enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString) + if (value is System.Collections.IEnumerable enumerableValue) + { + // some kind of enumerable value + return ToJsonValue(enumerableValue) ?? TryToJsonValue(value) ?? new JsonString(value.ToString()); + } + + // at this point, we're going to fallback to a string literal here, since we really have no idea what it is. + return new JsonString(value.ToString()); + } + + internal static JsonObject ToJson(System.Collections.Generic.Dictionary dictionary, JsonObject container) => ToJson((System.Collections.Generic.IDictionary)dictionary, container); + + /// + /// Serializes a dictionary into a JsonObject container. + /// + /// The dictionary to serailize + /// the container to serialize the dictionary into + /// the container + internal static JsonObject ToJson(System.Collections.Generic.IDictionary dictionary, JsonObject container) + { + container = container ?? new JsonObject(); + if (dictionary != null && dictionary.Count > 0) + { + foreach (var key in dictionary) + { + // currently, we don't serialize null values. + if (null != key.Value) + { + container.Add(key.Key, ToJsonValue(key.Value)); + continue; + } + } + } + return container; + } + + internal static Func> DeserializeDictionary(Func> dictionaryFactory) + { + return (node) => FromJson(node, dictionaryFactory(), (object)(DeserializeDictionary(dictionaryFactory)) as Func); + } + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.Dictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) => FromJson(json, (System.Collections.Generic.IDictionary)container, objectFactory, excludes); + + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.IDictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) + { + if (null == json) + { + return container; + } + + foreach (var key in json.Keys) + { + if (true == excludes?.Contains(key)) + { + continue; + } + + var value = json[key]; + try + { + switch (value.Type) + { + case JsonType.Null: + // skip null values. + continue; + + case JsonType.Array: + case JsonType.Boolean: + case JsonType.Date: + case JsonType.Binary: + case JsonType.Number: + case JsonType.String: + container.Add(key, (V)value.ToValue()); + break; + case JsonType.Object: + if (objectFactory != null) + { + var v = objectFactory(value as JsonObject); + if (null != v) + { + container.Add(key, v); + } + } + break; + } + } + catch + { + } + } + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonArray.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..659ef466b80e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonArray.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public partial class JsonArray + { + internal override object ToValue() => Count == 0 ? new object[0] : System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(this, each => each.ToValue())); + } + + +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..2b41e3ac0484 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonBoolean.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal partial class JsonBoolean + { + internal static JsonBoolean Create(bool? value) => value is bool b ? new JsonBoolean(b) : null; + internal bool ToBoolean() => Value; + + internal override object ToValue() => Value; + } + + +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonNode.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..39d105818e66 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonNode.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonNode + { + /// + /// Returns the content of this node as the underlying value. + /// Will default to the string representation if not overridden in child classes. + /// + /// an object with the underlying value of the node. + internal virtual object ToValue() { + return this.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..583ee4d3a3ed --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonNumber.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. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + using System; + + public partial class JsonNumber + { + internal static readonly DateTime EpochDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + private static long ToUnixTime(DateTime dateTime) + { + return (long)dateTime.Subtract(EpochDate).TotalSeconds; + } + private static DateTime FromUnixTime(long totalSeconds) + { + return EpochDate.AddSeconds(totalSeconds); + } + internal byte ToByte() => this; + internal int ToInt() => this; + internal long ToLong() => this; + internal short ToShort() => this; + internal UInt16 ToUInt16() => this; + internal UInt32 ToUInt32() => this; + internal UInt64 ToUInt64() => this; + internal decimal ToDecimal() => this; + internal double ToDouble() => this; + internal float ToFloat() => this; + + internal static JsonNumber Create(int? value) => value is int n ? new JsonNumber(n) : null; + internal static JsonNumber Create(long? value) => value is long n ? new JsonNumber(n) : null; + internal static JsonNumber Create(float? value) => value is float n ? new JsonNumber(n) : null; + internal static JsonNumber Create(double? value) => value is double n ? new JsonNumber(n) : null; + internal static JsonNumber Create(decimal? value) => value is decimal n ? new JsonNumber(n) : null; + internal static JsonNumber Create(DateTime? value) => value is DateTime date ? new JsonNumber(ToUnixTime(date)) : null; + + public static implicit operator DateTime(JsonNumber number) => FromUnixTime(number); + internal DateTime ToDateTime() => this; + + internal JsonNumber(decimal value) + { + this.value = value.ToString(); + } + internal override object ToValue() + { + if (IsInteger) + { + if (int.TryParse(this.value, out int iValue)) + { + return iValue; + } + if (long.TryParse(this.value, out long lValue)) + { + return lValue; + } + } + else + { + if (float.TryParse(this.value, out float fValue)) + { + return fValue; + } + if (double.TryParse(this.value, out double dValue)) + { + return dValue; + } + if (decimal.TryParse(this.value, out decimal dcValue)) + { + return dcValue; + } + } + return null; + } + } + + +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonObject.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..30185d16fb0b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonObject.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. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonObject + { + internal override object ToValue() => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.JsonSerializable.FromJson(this, new System.Collections.Generic.Dictionary(), (obj) => obj.ToValue()); + + internal void SafeAdd(string name, Func valueFn) + { + if (valueFn != null) + { + var value = valueFn(); + if (null != value) + { + items.Add(name, value); + } + } + } + + internal void SafeAdd(string name, JsonNode value) + { + if (null != value) + { + items.Add(name, value); + } + } + + internal T NullableProperty(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; + } + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + //throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal JsonObject Property(string propertyName) + { + return PropertyT(propertyName); + } + + internal T PropertyT(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; // we're going to assume that the consumer knows what to do if null is explicity returned? + } + + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + // throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal int NumberProperty(string propertyName, ref int output) => output = this.PropertyT(propertyName)?.ToInt() ?? output; + internal float NumberProperty(string propertyName, ref float output) => output = this.PropertyT(propertyName)?.ToFloat() ?? output; + internal byte NumberProperty(string propertyName, ref byte output) => output = this.PropertyT(propertyName)?.ToByte() ?? output; + internal long NumberProperty(string propertyName, ref long output) => output = this.PropertyT(propertyName)?.ToLong() ?? output; + internal double NumberProperty(string propertyName, ref double output) => output = this.PropertyT(propertyName)?.ToDouble() ?? output; + internal decimal NumberProperty(string propertyName, ref decimal output) => output = this.PropertyT(propertyName)?.ToDecimal() ?? output; + internal short NumberProperty(string propertyName, ref short output) => output = this.PropertyT(propertyName)?.ToShort() ?? output; + internal DateTime NumberProperty(string propertyName, ref DateTime output) => output = this.PropertyT(propertyName)?.ToDateTime() ?? output; + + internal int? NumberProperty(string propertyName, ref int? output) => output = this.NullableProperty(propertyName)?.ToInt() ?? null; + internal float? NumberProperty(string propertyName, ref float? output) => output = this.NullableProperty(propertyName)?.ToFloat() ?? null; + internal byte? NumberProperty(string propertyName, ref byte? output) => output = this.NullableProperty(propertyName)?.ToByte() ?? null; + internal long? NumberProperty(string propertyName, ref long? output) => output = this.NullableProperty(propertyName)?.ToLong() ?? null; + internal double? NumberProperty(string propertyName, ref double? output) => output = this.NullableProperty(propertyName)?.ToDouble() ?? null; + internal decimal? NumberProperty(string propertyName, ref decimal? output) => output = this.NullableProperty(propertyName)?.ToDecimal() ?? null; + internal short? NumberProperty(string propertyName, ref short? output) => output = this.NullableProperty(propertyName)?.ToShort() ?? null; + + internal DateTime? NumberProperty(string propertyName, ref DateTime? output) => output = this.NullableProperty(propertyName)?.ToDateTime() ?? null; + + + internal string StringProperty(string propertyName) => this.PropertyT(propertyName)?.ToString(); + internal string StringProperty(string propertyName, ref string output) => output = this.PropertyT(propertyName)?.ToString() ?? output; + internal char StringProperty(string propertyName, ref char output) => output = this.PropertyT(propertyName)?.ToChar() ?? output; + internal char? StringProperty(string propertyName, ref char? output) => output = this.PropertyT(propertyName)?.ToChar() ?? null; + + internal DateTime StringProperty(string propertyName, ref DateTime output) => DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out output) ? output : output; + internal DateTime? StringProperty(string propertyName, ref DateTime? output) => output = DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out var o) ? o : output; + + + internal bool BooleanProperty(string propertyName, ref bool output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? output; + internal bool? BooleanProperty(string propertyName, ref bool? output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? null; + + internal T[] ArrayProperty(string propertyName, ref T[] output, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + } + return output; + } + internal T[] ArrayProperty(string propertyName, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + var output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + return output; + } + return new T[0]; + } + internal void IterateArrayProperty(string propertyName, Action deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + for (var i = 0; i < array.Count; i++) + { + deserializer(array[i]); + } + } + } + + internal Dictionary DictionaryProperty(string propertyName, ref Dictionary output, Func deserializer) + { + var dictionary = this.PropertyT(propertyName); + if (output == null) + { + output = new Dictionary(); + } + else + { + output.Clear(); + } + if (dictionary != null) + { + foreach (var key in dictionary.Keys) + { + output[key] = deserializer(dictionary[key]); + } + } + return output; + } + + internal static JsonObject Create(IDictionary source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new JsonObject(); + + foreach (var key in source.Keys) + { + result.SafeAdd(key, selector(source[key])); + } + return result; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonString.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..7bd61b812c2f --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/JsonString.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + using System; + using System.Globalization; + using System.Linq; + + public partial class JsonString + { + internal static string DateFormat = "yyyy-MM-dd"; + internal static string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; + internal static string DateTimeRfc1123Format = "R"; + + internal static JsonString Create(string value) => value == null ? null : new JsonString(value); + internal static JsonString Create(char? value) => value is char c ? new JsonString(c.ToString()) : null; + + internal static JsonString CreateDate(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTime(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTimeRfc1123(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeRfc1123Format, CultureInfo.CurrentCulture)) : null; + + internal char ToChar() => this.Value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char(JsonString value) => value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char? (JsonString value) => value?.ToString()?.FirstOrDefault(); + + public static implicit operator DateTime(JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime); + public static implicit operator DateTime? (JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime?); + + } + + +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..a92c50478052 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Customizations/XNodeArray.cs @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + using System; + using System.Linq; + + public partial class XNodeArray + { + internal static XNodeArray Create(T[] source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new XNodeArray(); + foreach (var item in source.Select(selector)) + { + result.SafeAdd(item); + } + return result; + } + internal void SafeAdd(JsonNode item) + { + if (item != null) + { + items.Add(item); + } + } + internal void SafeAdd(Func itemFn) + { + if (itemFn != null) + { + var item = itemFn(); + if (item != null) + { + items.Add(item); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/EventData.cs b/swaggerci/recoveryservicesbackup/generated/runtime/EventData.cs new file mode 100644 index 000000000000..8263d93268fc --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/EventData.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. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + + using System; + using System.Threading; + + ///Represents the data in signaled event. + public partial class EventData + { + /// + /// The type of the event being signaled + /// + public string Id; + + /// + /// The user-ready message from the event. + /// + public string Message; + + /// + /// When the event is about a parameter, this is the parameter name. + /// Used in Validation Events + /// + public string Parameter; + + /// + /// This represents a numeric value associated with the event. + /// Use for progress-style events + /// + public double Value; + + /// + /// Any extended data for an event should be serialized and stored here. + /// + public string ExtendedData; + + /// + /// If the event triggers after the request message has been created, this will contain the Request Message (which in HTTP calls would be HttpRequestMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.RequestMessgae is HttpRequestMessage httpRequest) + /// { + /// httpRequest.Headers.Add("x-request-flavor", "vanilla"); + /// } + /// + /// + public object RequestMessage; + + /// + /// If the event triggers after the response is back, this will contain the Response Message (which in HTTP calls would be HttpResponseMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.ResponseMessage is HttpResponseMessage httpResponse){ + /// var flavor = httpResponse.Headers.GetValue("x-request-flavor"); + /// } + /// + /// + public object ResponseMessage; + + /// + /// Cancellation method for this event. + /// + /// If the event consumer wishes to cancel the request that initiated this event, call Cancel() + /// + /// + /// The original initiator of the request must provide the implementation of this. + /// + public System.Action Cancel; + } + +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/EventListener.cs b/swaggerci/recoveryservicesbackup/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..3bbea926faad --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/EventListener.cs @@ -0,0 +1,247 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public interface IValidates + { + Task Validate(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener listener); + } + + /// + /// The IEventListener Interface defines the communication mechanism for Signaling events during a remote call. + /// + /// + /// The interface is designed to be as minimal as possible, allow for quick peeking of the event type (id) + /// and the cancellation status and provides a delegate for retrieving the event details themselves. + /// + public interface IEventListener + { + Task Signal(string id, CancellationToken token, GetEventData createMessage); + CancellationToken Token { get; } + System.Action Cancel { get; } + } + + internal static partial class Extensions + { + public static Task Signal(this IEventListener instance, string id, CancellationToken token, Func createMessage) => instance.Signal(id, token, createMessage); + public static Task Signal(this IEventListener instance, string id, CancellationToken token) => instance.Signal(id, token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, EventData message) => instance.Signal(id, token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, Func createMessage) => instance.Signal(id, instance.Token, createMessage); + public static Task Signal(this IEventListener instance, string id) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, EventData message) => instance.Signal(id, instance.Token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, System.Uri uri) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = uri.ToString(), Cancel = instance.Cancel }); + + public static async Task AssertNotNull(this IEventListener instance, string parameterName, object value) + { + if (value == null) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' should not be null", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMinimumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length < length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is less than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMaximumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length > length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is greater than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + + public static async Task AssertRegEx(this IEventListener instance, string parameterName, string value, string regularExpression) + { + if (value != null && !System.Text.RegularExpressions.Regex.Match(value, regularExpression).Success) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' does not validate against pattern /{regularExpression}/", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertEnum(this IEventListener instance, string parameterName, string value, params string[] values) + { + if (!values.Any(each => each.Equals(value))) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' is not one of ({values.Aggregate((c, e) => $"'{e}',{c}")}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertObjectIsValid(this IEventListener instance, string parameterName, object inst) + { + await (inst as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates)?.Validate(instance); + } + + public static async Task AssertIsLessThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) >= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) <= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsLessThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) > 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) < 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, Int64? value, Int64 multiple) + { + if (null != value && value % multiple != 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, double? value, double multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, decimal? value, decimal multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + } + + /// + /// An Implementation of the IEventListener that supports subscribing to events and dispatching them + /// (used for manually using the lowlevel interface) + /// + public class EventListener : CancellationTokenSource, IEnumerable>, IEventListener + { + private Dictionary calls = new Dictionary(); + public IEnumerator> GetEnumerator() => calls.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => calls.GetEnumerator(); + public EventListener() + { + } + + public new Action Cancel => base.Cancel; + private Event tracer; + + public EventListener(params (string name, Event callback)[] initializer) + { + foreach (var each in initializer) + { + Add(each.name, each.callback); + } + } + + public void Add(string name, SynchEvent callback) + { + Add(name, (message) => { callback(message); return Task.CompletedTask; }); + } + + public void Add(string name, Event callback) + { + if (callback != null) + { + if (string.IsNullOrEmpty(name)) + { + if (calls.ContainsKey(name)) + { + tracer += callback; + } + else + { + tracer = callback; + } + } + else + { + if (calls.ContainsKey(name)) + { + calls[name ?? System.String.Empty] += callback; + } + else + { + calls[name ?? System.String.Empty] = callback; + } + } + } + } + + + public async Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + using (NoSynchronizationContext) + { + if (!string.IsNullOrEmpty(id) && (calls.TryGetValue(id, out Event listener) || tracer != null)) + { + var message = createMessage(); + message.Id = id; + + await listener?.Invoke(message); + await tracer?.Invoke(message); + + if (token.IsCancellationRequested) + { + throw new OperationCanceledException($"Canceled by event {id} ", this.Token); + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Events.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Events.cs new file mode 100644 index 000000000000..88bbe4e10f4a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Events.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. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + public static partial class Events + { + public const string Log = nameof(Log); + public const string Validation = nameof(Validation); + public const string ValidationWarning = nameof(ValidationWarning); + public const string AfterValidation = nameof(AfterValidation); + public const string RequestCreated = nameof(RequestCreated); + public const string ResponseCreated = nameof(ResponseCreated); + public const string URLCreated = nameof(URLCreated); + public const string Finally = nameof(Finally); + public const string HeaderParametersAdded = nameof(HeaderParametersAdded); + public const string BodyContentSet = nameof(BodyContentSet); + public const string BeforeCall = nameof(BeforeCall); + public const string BeforeResponseDispatch = nameof(BeforeResponseDispatch); + public const string FollowingNextLink = nameof(FollowingNextLink); + public const string DelayBeforePolling = nameof(DelayBeforePolling); + public const string Polling = nameof(Polling); + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Extensions.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..c2f5c5f6f7ab --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Extensions.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. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using System.Linq; + using System; + + internal static partial class Extensions + { + public static T[] SubArray(this T[] array, int offset, int length) + { + return new ArraySegment(array, offset, length) + .ToArray(); + } + + public static T ReadHeaders(this T instance, global::System.Net.Http.Headers.HttpResponseHeaders headers) where T : class + { + (instance as IHeaderSerializable)?.ReadHeaders(headers); + return instance; + } + + internal static bool If(T input, out T output) + { + if (null == input) + { + output = default(T); + return false; + } + output = input; + return true; + } + + internal static void AddIf(T value, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(value); + } + } + + internal static void AddIf(T value, string serializedName, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(serializedName, value); + } + } + + /// + /// Returns the first header value as a string from an HttpReponseMessage. + /// + /// the HttpResponseMessage to fetch a header from + /// the header name + /// the first header value as a string from an HttpReponseMessage. string.empty if there is no header value matching + internal static string GetFirstHeader(this System.Net.Http.HttpResponseMessage response, string headerName) => response.Headers.FirstOrDefault(each => string.Equals(headerName, each.Key, System.StringComparison.OrdinalIgnoreCase)).Value?.FirstOrDefault() ?? string.Empty; + + /// + /// Sets the Synchronization Context to null, and returns an IDisposable that when disposed, + /// will restore the synchonization context to the original value. + /// + /// This is used a less-invasive means to ensure that code in the library that doesn't + /// need to be continued in the original context doesn't have to have ConfigureAwait(false) + /// on every single await + /// + /// If the SynchronizationContext is null when this is used, the resulting IDisposable + /// will not do anything (this prevents excessive re-setting of the SynchronizationContext) + /// + /// Usage: + /// + /// using(NoSynchronizationContext) { + /// await SomeAsyncOperation(); + /// await SomeOtherOperation(); + /// } + /// + /// + /// + /// An IDisposable that will return the SynchronizationContext to original state + internal static System.IDisposable NoSynchronizationContext => System.Threading.SynchronizationContext.Current == null ? Dummy : new NoSyncContext(); + + /// + /// An instance of the Dummy IDispoable. + /// + /// + internal static System.IDisposable Dummy = new DummyDisposable(); + + /// + /// An IDisposable that does absolutely nothing. + /// + internal class DummyDisposable : System.IDisposable + { + public void Dispose() + { + } + } + /// + /// An IDisposable that saves the SynchronizationContext,sets it to null and + /// restores it to the original upon Dispose(). + /// + /// NOTE: This is designed to be less invasive than using .ConfigureAwait(false) + /// on every single await in library code (ie, places where we know we don't need + /// to continue in the same context as we went async) + /// + internal class NoSyncContext : System.IDisposable + { + private System.Threading.SynchronizationContext original = System.Threading.SynchronizationContext.Current; + internal NoSyncContext() + { + System.Threading.SynchronizationContext.SetSynchronizationContext(null); + } + public void Dispose() => System.Threading.SynchronizationContext.SetSynchronizationContext(original); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..36985016a162 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Extensions/StringBuilderExtensions.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. + *--------------------------------------------------------------------------------------------*/ +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal static class StringBuilderExtensions + { + /// + /// Extracts the buffered value and resets the buffer + /// + internal static string Extract(this StringBuilder builder) + { + var text = builder.ToString(); + + builder.Clear(); + + return text; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..c68d79f90c16 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Extensions/TypeExtensions.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. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal static class TypeExtensions + { + internal static bool IsNullable(this Type type) => + type.IsGenericType && type.GetGenericTypeDefinition().Equals(typeof(Nullable<>)); + + internal static Type GetOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition() == openGenericInterfaceType) + { + return candidateType; + } + + // Check if it references it's own converter.... + + foreach (Type interfaceType in candidateType.GetInterfaces()) + { + if (interfaceType.IsGenericType + && interfaceType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return interfaceType; + } + } + + return null; + } + + // Author: Sebastian Good + // http://stackoverflow.com/questions/503263/how-to-determine-if-a-type-implements-a-specific-generic-interface-type + internal static bool ImplementsOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + if (candidateType.Equals(openGenericInterfaceType)) + { + return true; + } + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return true; + } + + foreach (Type i in candidateType.GetInterfaces()) + { + if (i.IsGenericType && i.ImplementsOpenGenericInterface(openGenericInterfaceType)) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Seperator.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..feefa7e7dc1e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/Seperator.cs @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal static class Seperator + { + internal static readonly char[] Dash = { '-' }; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..72f80462b988 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/TypeDetails.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + + + + internal class TypeDetails + { + private readonly Type info; + + internal TypeDetails(Type info) + { + this.info = info ?? throw new ArgumentNullException(nameof(info)); + } + + internal Type NonNullType { get; set; } + + internal object DefaultValue { get; set; } + + internal bool IsNullable { get; set; } + + internal bool IsList { get; set; } + + internal bool IsStringLike { get; set; } + + internal bool IsEnum => info.IsEnum; + + internal bool IsArray => info.IsArray; + + internal bool IsValueType => info.IsValueType; + + internal Type ElementType { get; set; } + + internal IJsonConverter JsonConverter { get; set; } + + #region Creation + + private static readonly ConcurrentDictionary cache = new ConcurrentDictionary(); + + internal static TypeDetails Get() => Get(typeof(T)); + + internal static TypeDetails Get(Type type) => cache.GetOrAdd(type, Create); + + private static TypeDetails Create(Type type) + { + var isGenericList = !type.IsPrimitive && type.ImplementsOpenGenericInterface(typeof(IList<>)); + var isList = !type.IsPrimitive && (isGenericList || typeof(IList).IsAssignableFrom(type)); + + var isNullable = type.IsNullable(); + + Type elementType; + + if (type.IsArray) + { + elementType = type.GetElementType(); + } + else if (isGenericList) + { + var iList = type.GetOpenGenericInterface(typeof(IList<>)); + + elementType = iList.GetGenericArguments()[0]; + } + else + { + elementType = null; + } + + var nonNullType = isNullable ? type.GetGenericArguments()[0] : type; + + var isStringLike = false; + + IJsonConverter converter; + + var jsonConverterAttribute = type.GetCustomAttribute(); + + if (jsonConverterAttribute != null) + { + converter = jsonConverterAttribute.Converter; + } + else if (nonNullType.IsEnum) + { + converter = new EnumConverter(nonNullType); + } + else if (JsonConverterFactory.Instances.TryGetValue(nonNullType, out converter)) + { + } + else if (StringLikeHelper.IsStringLike(nonNullType)) + { + isStringLike = true; + + converter = new StringLikeConverter(nonNullType); + } + + return new TypeDetails(nonNullType) { + NonNullType = nonNullType, + DefaultValue = type.IsValueType ? Activator.CreateInstance(type) : null, + IsNullable = isNullable, + IsList = isList, + IsStringLike = isStringLike, + ElementType = elementType, + JsonConverter = converter + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/XHelper.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..bb274146f707 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Helpers/XHelper.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. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal static class XHelper + { + internal static JsonNode Create(JsonType type, TypeCode code, object value) + { + switch (type) + { + case JsonType.Binary : return new XBinary((byte[])value); + case JsonType.Boolean : return new JsonBoolean((bool)value); + case JsonType.Number : return new JsonNumber(value.ToString()); + case JsonType.String : return new JsonString((string)value); + } + + throw new Exception($"JsonType '{type}' does not have a fast conversion"); + } + + internal static bool TryGetElementType(TypeCode code, out JsonType type) + { + switch (code) + { + case TypeCode.Boolean : type = JsonType.Boolean; return true; + case TypeCode.Byte : type = JsonType.Number; return true; + case TypeCode.DateTime : type = JsonType.Date; return true; + case TypeCode.Decimal : type = JsonType.Number; return true; + case TypeCode.Double : type = JsonType.Number; return true; + case TypeCode.Empty : type = JsonType.Null; return true; + case TypeCode.Int16 : type = JsonType.Number; return true; + case TypeCode.Int32 : type = JsonType.Number; return true; + case TypeCode.Int64 : type = JsonType.Number; return true; + case TypeCode.SByte : type = JsonType.Number; return true; + case TypeCode.Single : type = JsonType.Number; return true; + case TypeCode.String : type = JsonType.String; return true; + case TypeCode.UInt16 : type = JsonType.Number; return true; + case TypeCode.UInt32 : type = JsonType.Number; return true; + case TypeCode.UInt64 : type = JsonType.Number; return true; + } + + type = default; + + return false; + } + + internal static JsonType GetElementType(TypeCode code) + { + switch (code) + { + case TypeCode.Boolean : return JsonType.Boolean; + case TypeCode.Byte : return JsonType.Number; + case TypeCode.DateTime : return JsonType.Date; + case TypeCode.Decimal : return JsonType.Number; + case TypeCode.Double : return JsonType.Number; + case TypeCode.Empty : return JsonType.Null; + case TypeCode.Int16 : return JsonType.Number; + case TypeCode.Int32 : return JsonType.Number; + case TypeCode.Int64 : return JsonType.Number; + case TypeCode.SByte : return JsonType.Number; + case TypeCode.Single : return JsonType.Number; + case TypeCode.String : return JsonType.String; + case TypeCode.UInt16 : return JsonType.Number; + case TypeCode.UInt32 : return JsonType.Number; + case TypeCode.UInt64 : return JsonType.Number; + default : return JsonType.Object; + } + + throw new Exception($"TypeCode '{code}' does not have a fast converter"); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/IAssociativeArray.cs b/swaggerci/recoveryservicesbackup/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..f3c81da7eae5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/IAssociativeArray.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. + *--------------------------------------------------------------------------------------------*/ +#define DICT_PROPERTIES +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + /// A subset of IDictionary that doesn't implement IEnumerable or IDictionary to work around PowerShell's aggressive formatter + public interface IAssociativeArray + { +#if DICT_PROPERTIES + System.Collections.Generic.IEnumerable Keys { get; } + System.Collections.Generic.IEnumerable Values { get; } + int Count { get; } +#endif + System.Collections.Generic.IDictionary AdditionalProperties { get; } + T this[string index] { get; set; } + void Add(string key, T value); + bool ContainsKey(string key); + bool Remove(string key); + bool TryGetValue(string key, out T value); + void Clear(); + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/IHeaderSerializable.cs b/swaggerci/recoveryservicesbackup/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..9cb1162500b5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/IHeaderSerializable.cs @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + public interface IHeaderSerializable + { + void ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers); + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/ISendAsync.cs b/swaggerci/recoveryservicesbackup/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..58693165dcd5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/ISendAsync.cs @@ -0,0 +1,296 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + /// + /// The interface for sending an HTTP request across the wire. + /// + public interface ISendAsync + { + Task SendAsync(HttpRequestMessage request, IEventListener callback); + } + + public class SendAsyncTerminalFactory : ISendAsyncTerminalFactory, ISendAsync + { + SendAsync implementation; + + public SendAsyncTerminalFactory(SendAsync implementation) => this.implementation = implementation; + public SendAsyncTerminalFactory(ISendAsync implementation) => this.implementation = implementation.SendAsync; + public ISendAsync Create() => this; + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback); + } + + public partial class SendAsyncFactory : ISendAsyncFactory + { + public class Sender : ISendAsync + { + internal ISendAsync next; + internal SendAsyncStep implementation; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback, next); + } + SendAsyncStep implementation; + + public SendAsyncFactory(SendAsyncStep implementation) => this.implementation = implementation; + public ISendAsync Create(ISendAsync next) => new Sender { next = next, implementation = implementation }; + + } + + public class HttpClientFactory : ISendAsyncTerminalFactory, ISendAsync + { + HttpClient client; + public HttpClientFactory() : this(new HttpClient()) + { + } + public HttpClientFactory(HttpClient client) => this.client = client; + public ISendAsync Create() => this; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, callback.Token); + } + + public interface ISendAsyncFactory + { + ISendAsync Create(ISendAsync next); + } + + public interface ISendAsyncTerminalFactory + { + ISendAsync Create(); + } + + public partial class HttpPipeline : ISendAsync + { + private ISendAsync pipeline; + private ISendAsyncTerminalFactory terminal; + private List steps = new List(); + + public HttpPipeline() : this(new HttpClientFactory()) + { + } + + public HttpPipeline(ISendAsyncTerminalFactory terminalStep) + { + if (terminalStep == null) + { + throw new System.ArgumentNullException(nameof(terminalStep), "Terminal Step Factory in HttpPipeline may not be null"); + } + TerminalFactory = terminalStep; + } + + /// + /// Returns an HttpPipeline with the current state of this pipeline. + /// + public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + + public ISendAsyncTerminalFactory TerminalFactory + { + get => terminal; + set + { + if (value == null) + { + throw new System.ArgumentNullException("TerminalFactory in HttpPipeline may not be null"); + } + terminal = value; + } + } + + public ISendAsync Pipeline + { + get + { + // if the pipeline has been created and not invalidated, return it. + if (this.pipeline != null) + { + return this.pipeline; + } + + // create the pipeline from scratch. + var next = terminal.Create(); + foreach (var factory in steps) + { + // skip factories that return null. + next = factory.Create(next) ?? next; + } + return this.pipeline = next; + } + } + + public int Count => steps.Count; + + public HttpPipeline Prepend(ISendAsyncFactory item) + { + if (item != null) + { + steps.Add(item); + pipeline = null; + } + return this; + } + + public HttpPipeline Append(SendAsyncStep item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStep item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Append(ISendAsyncFactory item) + { + if (item != null) + { + steps.Insert(0, item); + pipeline = null; + } + return this; + } + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(item); + } + } + return this; + } + + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(item); + } + } + return this; + } + + // you can use this as the ISendAsync Implementation + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => Pipeline.SendAsync(request, callback); + } + + internal static partial class Extensions + { + internal static HttpRequestMessage CloneAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.Clone(requestUri, method); + } + } + + internal static Task CloneWithContentAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.CloneWithContent(requestUri, method); + } + } + + /// + /// Clones an HttpRequestMessage (without the content) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// A clone of the HttpRequestMessage + internal static HttpRequestMessage Clone(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = new HttpRequestMessage + { + Method = method ?? original.Method, + RequestUri = requestUri ?? original.RequestUri, + Version = original.Version, + }; + + foreach (KeyValuePair prop in original.Properties) + { + clone.Properties.Add(prop); + } + + foreach (KeyValuePair> header in original.Headers) + { + /* + **temporarily skip cloning telemetry related headers** + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + */ + if (!"x-ms-unique-id".Equals(header.Key) && !"x-ms-client-request-id".Equals(header.Key) && !"CommandName".Equals(header.Key) && !"FullCommandName".Equals(header.Key) && !"ParameterSetName".Equals(header.Key) && !"User-Agent".Equals(header.Key)) + { + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + } + + return clone; + } + + /// + /// Clones an HttpRequestMessage (including the content stream and content headers) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// A clone of the HttpRequestMessage + internal static async Task CloneWithContent(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = original.Clone(requestUri, method); + var stream = new System.IO.MemoryStream(); + if (original.Content != null) + { + await original.Content.CopyToAsync(stream).ConfigureAwait(false); + stream.Position = 0; + clone.Content = new StreamContent(stream); + if (original.Content.Headers != null) + { + foreach (var h in original.Content.Headers) + { + clone.Content.Headers.Add(h.Key, h.Value); + } + } + } + return clone; + } + } +} diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/InfoAttribute.cs b/swaggerci/recoveryservicesbackup/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..ba76050cd5af --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/InfoAttribute.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using System; + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class)] + public class InfoAttribute : Attribute + { + public bool Required { get; set; } = false; + public bool ReadOnly { get; set; } = false; + public Type[] PossibleTypes { get; set; } = new Type[0]; + public string Description { get; set; } = ""; + public string SerializedName { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class CompleterInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class DefaultInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Iso/IsoDate.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..db644708016b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Iso/IsoDate.cs @@ -0,0 +1,214 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal struct IsoDate + { + internal int Year { get; set; } // 0-3000 + + internal int Month { get; set; } // 1-12 + + internal int Day { get; set; } // 1-31 + + internal int Hour { get; set; } // 0-24 + + internal int Minute { get; set; } // 0-60 (60 is a special case) + + internal int Second { get; set; } // 0-60 (60 is used for leap seconds) + + internal double Millisecond { get; set; } // 0-999.9... + + internal TimeSpan Offset { get; set; } + + internal DateTimeKind Kind { get; set; } + + internal TimeSpan TimeOfDay => new TimeSpan(Hour, Minute, Second); + + internal DateTime ToDateTime() + { + if (Kind == DateTimeKind.Utc || Offset == TimeSpan.Zero) + { + return new DateTime(Year, Month, Day, Hour, Minute, Second, (int)Millisecond, DateTimeKind.Utc); + } + + return ToDateTimeOffset().DateTime; + } + + internal DateTimeOffset ToDateTimeOffset() + { + return new DateTimeOffset( + Year, + Month, + Day, + Hour, + Minute, + Second, + (int)Millisecond, + Offset + ); + } + + internal DateTime ToUtcDateTime() + { + return ToDateTimeOffset().UtcDateTime; + } + + public override string ToString() + { + var sb = new StringBuilder(); + + // yyyy-MM-dd + sb.Append($"{Year}-{Month:00}-{Day:00}"); + + if (TimeOfDay > new TimeSpan(0)) + { + sb.Append($"T{Hour:00}:{Minute:00}"); + + if (TimeOfDay.Seconds > 0) + { + sb.Append($":{Second:00}"); + } + } + + if (Offset.Ticks == 0) + { + sb.Append('Z'); // UTC + } + else + { + if (Offset.Ticks >= 0) + { + sb.Append('+'); + } + + sb.Append($"{Offset.Hours:00}:{Offset.Minutes:00}"); + } + + return sb.ToString(); + } + + internal static IsoDate FromDateTimeOffset(DateTimeOffset date) + { + return new IsoDate { + Year = date.Year, + Month = date.Month, + Day = date.Day, + Hour = date.Hour, + Minute = date.Minute, + Second = date.Second, + Offset = date.Offset, + Kind = date.Offset == TimeSpan.Zero ? DateTimeKind.Utc : DateTimeKind.Unspecified + }; + } + + private static readonly char[] timeSeperators = { ':', '.' }; + + internal static IsoDate Parse(string text) + { + var tzIndex = -1; + var timeIndex = text.IndexOf('T'); + + var builder = new IsoDate { Day = 1, Month = 1 }; + + // TODO: strip the time zone offset off the end + string dateTime = text; + string timeZone = null; + + if (dateTime.IndexOf('Z') > -1) + { + tzIndex = dateTime.LastIndexOf('Z'); + + builder.Kind = DateTimeKind.Utc; + } + else if (dateTime.LastIndexOf('+') > 10) + { + tzIndex = dateTime.LastIndexOf('+'); + } + else if (dateTime.LastIndexOf('-') > 10) + { + tzIndex = dateTime.LastIndexOf('-'); + } + + if (tzIndex > -1) + { + timeZone = dateTime.Substring(tzIndex); + dateTime = dateTime.Substring(0, tzIndex); + } + + string date = (timeIndex == -1) ? dateTime : dateTime.Substring(0, timeIndex); + + var dateParts = date.Split(Seperator.Dash); // '-' + + for (int i = 0; i < dateParts.Length; i++) + { + var part = dateParts[i]; + + switch (i) + { + case 0: builder.Year = int.Parse(part); break; + case 1: builder.Month = int.Parse(part); break; + case 2: builder.Day = int.Parse(part); break; + } + } + + if (timeIndex > -1) + { + string[] timeParts = dateTime.Substring(timeIndex + 1).Split(timeSeperators); + + for (int i = 0; i < timeParts.Length; i++) + { + var part = timeParts[i]; + + switch (i) + { + case 0: builder.Hour = int.Parse(part); break; + case 1: builder.Minute = int.Parse(part); break; + case 2: builder.Second = int.Parse(part); break; + case 3: builder.Millisecond = double.Parse("0." + part) * 1000; break; + } + } + } + + if (timeZone != null && timeZone != "Z") + { + var hours = int.Parse(timeZone.Substring(1, 2)); + var minutes = int.Parse(timeZone.Substring(4, 2)); + + if (timeZone[0] == '-') + { + hours = -hours; + minutes = -minutes; + } + + builder.Offset = new TimeSpan(hours, minutes, 0); + } + + return builder; + } + } + + /* + YYYY # eg 1997 + YYYY-MM # eg 1997-07 + YYYY-MM-DD # eg 1997-07-16 + YYYY-MM-DDThh:mmTZD # eg 1997-07-16T19:20+01:00 + YYYY-MM-DDThh:mm:ssTZD # eg 1997-07-16T19:20:30+01:00 + YYYY-MM-DDThh:mm:ss.sTZD # eg 1997-07-16T19:20:30.45+01:00 + + where: + + YYYY = four-digit year + MM = two-digit month (01=January, etc.) + DD = two-digit day of month (01 through 31) + hh = two digits of hour (00 through 23) (am/pm NOT allowed) + mm = two digits of minute (00 through 59) + ss = two digits of second (00 through 59) + s = one or more digits representing a decimal fraction of a second + TZD = time zone designator (Z or +hh:mm or -hh:mm) + */ +} diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/JsonType.cs b/swaggerci/recoveryservicesbackup/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..b0bfde2b2e61 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/JsonType.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal enum JsonType + { + Null = 0, + Object = 1, + Array = 2, + Binary = 3, + Boolean = 4, + Date = 5, + Number = 6, + String = 7 + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Method.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Method.cs new file mode 100644 index 000000000000..ee2f19ec1075 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Method.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + internal static class Method + { + internal static System.Net.Http.HttpMethod Get = System.Net.Http.HttpMethod.Get; + internal static System.Net.Http.HttpMethod Put = System.Net.Http.HttpMethod.Put; + internal static System.Net.Http.HttpMethod Head = System.Net.Http.HttpMethod.Head; + internal static System.Net.Http.HttpMethod Post = System.Net.Http.HttpMethod.Post; + internal static System.Net.Http.HttpMethod Delete = System.Net.Http.HttpMethod.Delete; + internal static System.Net.Http.HttpMethod Options = System.Net.Http.HttpMethod.Options; + internal static System.Net.Http.HttpMethod Trace = System.Net.Http.HttpMethod.Trace; + internal static System.Net.Http.HttpMethod Patch = new System.Net.Http.HttpMethod("PATCH"); + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonMember.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..d0c0faecd5c4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonMember.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; +using System.Runtime.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + + + internal sealed class JsonMember + { + private readonly TypeDetails type; + + private readonly Func getter; + private readonly Action setter; + + internal JsonMember(PropertyInfo property, int defaultOrder) + { + getter = property.GetValue; + setter = property.SetValue; + + var dataMember = property.GetCustomAttribute(); + + Name = dataMember?.Name ?? property.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(property.PropertyType); + + CanRead = property.CanRead; + } + + internal JsonMember(FieldInfo field, int defaultOrder) + { + getter = field.GetValue; + setter = field.SetValue; + + var dataMember = field.GetCustomAttribute(); + + Name = dataMember?.Name ?? field.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(field.FieldType); + + CanRead = true; + } + + internal string Name { get; } + + internal int Order { get; } + + internal TypeDetails TypeDetails => type; + + internal Type Type => type.NonNullType; + + internal bool IsList => type.IsList; + + // Arrays, Sets, ... + internal Type ElementType => type.ElementType; + + internal IJsonConverter Converter => type.JsonConverter; + + internal bool EmitDefaultValue { get; } + + internal bool IsStringLike => type.IsStringLike; + + internal object DefaultValue => type.DefaultValue; + + internal bool CanRead { get; } + + #region Helpers + + internal object GetValue(object instance) => getter(instance); + + internal void SetValue(object instance, object value) => setter(instance, value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonModel.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..cd34e7d51318 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonModel.cs @@ -0,0 +1,89 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal class JsonModel + { + private Dictionary map; + private readonly object _sync = new object(); + + private JsonModel(Type type, List members) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + Members = members ?? throw new ArgumentNullException(nameof(members)); + } + + internal string Name => Type.Name; + + internal Type Type { get; } + + internal List Members { get; } + + internal JsonMember this[string name] + { + get + { + if (map == null) + { + lock (_sync) + { + if (map == null) + { + map = new Dictionary(); + + foreach (JsonMember m in Members) + { + map[m.Name.ToLower()] = m; + } + } + } + } + + + map.TryGetValue(name.ToLower(), out JsonMember member); + + return member; + } + } + + internal static JsonModel FromType(Type type) + { + var members = new List(); + + int i = 0; + + // BindingFlags.Instance | BindingFlags.Public + + foreach (var member in type.GetFields()) + { + if (member.IsStatic) continue; + + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + foreach (var member in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + members.Sort((a, b) => a.Order.CompareTo(b.Order)); // inline sort + + return new JsonModel(type, members); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonModelCache.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..f6f379219e9d --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Models/JsonModelCache.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Runtime.CompilerServices; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal static class JsonModelCache + { + private static readonly ConditionalWeakTable cache + = new ConditionalWeakTable(); + + internal static JsonModel Get(Type type) => cache.GetValue(type, Create); + + private static JsonModel Create(Type type) => JsonModel.FromType(type); + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..65fcf055ef0e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/JsonArray.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public abstract partial class JsonArray : JsonNode, IEnumerable + { + internal override JsonType Type => JsonType.Array; + + internal abstract JsonType? ElementType { get; } + + public abstract int Count { get; } + + internal virtual bool IsSet => false; + + internal bool IsEmpty => Count == 0; + + #region IEnumerable + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + + #region Static Helpers + + internal static JsonArray Create(short[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(int[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(long[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(decimal[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(float[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(string[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(XBinary[] values) + => new XImmutableArray(values); + + #endregion + + internal static new JsonArray Parse(string text) + => (JsonArray)JsonNode.Parse(text); + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..222eb104e7a0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XImmutableArray.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal sealed class XImmutableArray : JsonArray, IEnumerable + { + private readonly T[] values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XImmutableArray(T[] values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Length; + + public bool IsReadOnly => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + #region Static Constructor + + internal XImmutableArray Create(T[] items) + { + return new XImmutableArray(items); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..8016079b1e45 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XList.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal sealed class XList : JsonArray, IEnumerable + { + private readonly IList values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XList(IList values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Count; + + public bool IsReadOnly => values.IsReadOnly; + + #region IList + + public void Add(T value) + { + values.Add(value); + } + + public bool Contains(T value) => values.Contains(value); + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..89ccec74562c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XNodeArray.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. + *--------------------------------------------------------------------------------------------*/ +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed partial class XNodeArray : JsonArray, ICollection + { + private readonly List items; + + internal XNodeArray() + { + items = new List(); + } + + internal XNodeArray(params JsonNode[] values) + { + items = new List(values); + } + + public override JsonNode this[int index] => items[index]; + + internal override JsonType? ElementType => null; + + public bool IsReadOnly => false; + + public override int Count => items.Count; + + #region ICollection Members + + public void Add(JsonNode item) + { + items.Add(item); + } + + void ICollection.Clear() + { + items.Clear(); + } + + public bool Contains(JsonNode item) => items.Contains(item); + + void ICollection.CopyTo(JsonNode[] array, int arrayIndex) + { + items.CopyTo(array, arrayIndex); + } + + public bool Remove(JsonNode item) + { + return items.Remove(item); + } + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..40026dad8bca --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/Collections/XSet.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal sealed class XSet : JsonArray, IEnumerable + { + private readonly HashSet values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XSet(IEnumerable values) + : this(new HashSet(values)) + { } + + internal XSet(HashSet values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + internal override JsonType Type => JsonType.Array; + + internal override JsonType? ElementType => elementType; + + public bool IsReadOnly => true; + + public override int Count => values.Count; + + internal override bool IsSet => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + internal HashSet AsHashSet() => values; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..ce3386cae623 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonBoolean.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal sealed partial class JsonBoolean : JsonNode + { + internal static readonly JsonBoolean True = new JsonBoolean(true); + internal static readonly JsonBoolean False = new JsonBoolean(false); + + internal JsonBoolean(bool value) + { + Value = value; + } + + internal bool Value { get; } + + internal override JsonType Type => JsonType.Boolean; + + internal static new JsonBoolean Parse(string text) + { + switch (text) + { + case "false": return False; + case "true": return True; + + default: throw new ArgumentException($"Expected true or false. Was {text}."); + } + } + + #region Implicit Casts + + public static implicit operator bool(JsonBoolean data) => data.Value; + + public static implicit operator JsonBoolean(bool data) => new JsonBoolean(data); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonDate.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..5c04b5f6208a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonDate.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. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + + + internal sealed partial class JsonDate : JsonNode, IEquatable, IComparable + { + internal static bool AssumeUtcWhenKindIsUnspecified = true; + + private readonly DateTimeOffset value; + + internal JsonDate(DateTime value) + { + if (value.Kind == DateTimeKind.Unspecified && AssumeUtcWhenKindIsUnspecified) + { + value = DateTime.SpecifyKind(value, DateTimeKind.Utc); + } + + this.value = value; + } + + internal JsonDate(DateTimeOffset value) + { + this.value = value; + } + + internal override JsonType Type => JsonType.Date; + + #region Helpers + + internal DateTimeOffset ToDateTimeOffset() + { + return value; + } + + internal DateTime ToDateTime() + { + if (value.Offset == TimeSpan.Zero) + { + return value.UtcDateTime; + } + + return value.DateTime; + } + + internal DateTime ToUtcDateTime() => value.UtcDateTime; + + internal int ToUnixTimeSeconds() + { + return (int)value.ToUnixTimeSeconds(); + } + + internal long ToUnixTimeMilliseconds() + { + return (int)value.ToUnixTimeMilliseconds(); + } + + internal string ToIsoString() + { + return IsoDate.FromDateTimeOffset(value).ToString(); + } + + #endregion + + public override string ToString() + { + return ToIsoString(); + } + + internal static new JsonDate Parse(string text) + { + if (text == null) throw new ArgumentNullException(nameof(text)); + + // TODO support: unixtimeseconds.partialseconds + + if (text.Length > 4 && _IsNumber(text)) // UnixTime + { + var date = DateTimeOffset.FromUnixTimeSeconds(long.Parse(text)); + + return new JsonDate(date); + } + else if (text.Length <= 4 || text[4] == '-') // ISO: 2012- + { + return new JsonDate(IsoDate.Parse(text).ToDateTimeOffset()); + } + else + { + // NOT ISO ENCODED + // "Thu, 5 Apr 2012 16:59:01 +0200", + return new JsonDate(DateTimeOffset.Parse(text)); + } + } + + private static bool _IsNumber(string text) + { + foreach (var c in text) + { + if (!char.IsDigit(c)) return false; + } + + return true; + } + + internal static JsonDate FromUnixTime(int seconds) + { + return new JsonDate(DateTimeOffset.FromUnixTimeSeconds(seconds)); + } + + internal static JsonDate FromUnixTime(double seconds) + { + var milliseconds = (long)(seconds * 1000d); + + return new JsonDate(DateTimeOffset.FromUnixTimeMilliseconds(milliseconds)); + } + + #region Implicit Casts + + public static implicit operator DateTimeOffset(JsonDate value) + => value.ToDateTimeOffset(); + + public static implicit operator DateTime(JsonDate value) + => value.ToDateTime(); + + // From Date + public static implicit operator JsonDate(DateTimeOffset value) + { + return new JsonDate(value); + } + + public static implicit operator JsonDate(DateTime value) + { + return new JsonDate(value); + } + + // From String + public static implicit operator JsonDate(string value) + { + return Parse(value); + } + + #endregion + + #region Equality + + public override bool Equals(object obj) + { + return obj is JsonDate date && date.value == this.value; + } + + public bool Equals(JsonDate other) + { + return this.value == other.value; + } + + public override int GetHashCode() => value.GetHashCode(); + + #endregion + + #region IComparable Members + + int IComparable.CompareTo(JsonDate other) + { + return value.CompareTo(other.value); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonNode.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..e4c62f076728 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonNode.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + + + public abstract partial class JsonNode + { + internal abstract JsonType Type { get; } + + public virtual JsonNode this[int index] => throw new NotImplementedException(); + + public virtual JsonNode this[string name] + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #region Type Helpers + + internal bool IsArray => Type == JsonType.Array; + + internal bool IsDate => Type == JsonType.Date; + + internal bool IsObject => Type == JsonType.Object; + + internal bool IsNumber => Type == JsonType.Number; + + internal bool IsNull => Type == JsonType.Null; + + #endregion + + internal void WriteTo(TextWriter textWriter, bool pretty = true) + { + var writer = new JsonWriter(textWriter, pretty); + + writer.WriteNode(this); + } + + internal T As() + where T : new() + => new JsonSerializer().Deseralize((JsonObject)this); + + internal T[] ToArrayOf() + { + return (T[])new JsonSerializer().DeserializeArray(typeof(T[]), (JsonArray)this); + } + + #region ToString Overrides + + public override string ToString() => ToString(pretty: true); + + internal string ToString(bool pretty) + { + var sb = new StringBuilder(); + + using (var writer = new StringWriter(sb)) + { + WriteTo(writer, pretty); + + return sb.ToString(); + } + } + + #endregion + + #region Static Constructors + + internal static JsonNode Parse(string text) + { + return Parse(new SourceReader(new StringReader(text))); + } + + internal static JsonNode Parse(TextReader textReader) + => Parse(new SourceReader(textReader)); + + private static JsonNode Parse(SourceReader sourceReader) + { + using (var parser = new JsonParser(sourceReader)) + { + return parser.ReadNode(); + } + } + + internal static JsonNode FromObject(object instance) + => new JsonSerializer().Serialize(instance); + + #endregion + + #region Implict Casts + + public static implicit operator string(JsonNode node) => node.ToString(); + + #endregion + + #region Explict Casts + + public static explicit operator DateTime(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date: + return ((JsonDate)node).ToDateTime(); + + case JsonType.String: + return JsonDate.Parse(node.ToString()).ToDateTime(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num).UtcDateTime; + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)).UtcDateTime; + } + } + + throw new ConversionException(node, typeof(DateTime)); + } + + public static explicit operator DateTimeOffset(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date : return ((JsonDate)node).ToDateTimeOffset(); + case JsonType.String : return JsonDate.Parse(node.ToString()).ToDateTimeOffset(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num); + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)); + } + + } + + throw new ConversionException(node, typeof(DateTimeOffset)); + } + + public static explicit operator float(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return float.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(float)); + } + + public static explicit operator double(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return double.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(double)); + } + + public static explicit operator decimal(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return decimal.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(decimal)); + } + + public static explicit operator Guid(JsonNode node) + => new Guid(node.ToString()); + + public static explicit operator short(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return short.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(short)); + } + + public static explicit operator int(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return int.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(int)); + } + + public static explicit operator long(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return long.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(long)); + } + + public static explicit operator bool(JsonNode node) + => ((JsonBoolean)node).Value; + + public static explicit operator ushort(JsonNode node) + => (JsonNumber)node; + + public static explicit operator uint(JsonNode node) + => (JsonNumber)node; + + public static explicit operator ulong(JsonNode node) + => (JsonNumber)node; + + public static explicit operator TimeSpan(JsonNode node) + => TimeSpan.Parse(node.ToString()); + + public static explicit operator Uri(JsonNode node) + { + if (node.Type == JsonType.String) + { + return new Uri(node.ToString()); + } + + throw new ConversionException(node, typeof(Uri)); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..74497b1bb07e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonNumber.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. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed partial class JsonNumber : JsonNode + { + private readonly string value; + private readonly bool overflows = false; + + internal JsonNumber(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal JsonNumber(int value) + { + this.value = value.ToString(); + } + + internal JsonNumber(long value) + { + this.value = value.ToString(); + + if (value > 9007199254740991) + { + overflows = true; + } + } + + internal JsonNumber(float value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal JsonNumber(double value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal override JsonType Type => JsonType.Number; + + internal string Value => value; + + #region Helpers + + internal bool Overflows => overflows; + + internal bool IsInteger => !value.Contains("."); + + internal bool IsFloat => value.Contains("."); + + #endregion + + #region Casting + + public static implicit operator byte(JsonNumber number) + => byte.Parse(number.Value); + + public static implicit operator short(JsonNumber number) + => short.Parse(number.Value); + + public static implicit operator int(JsonNumber number) + => int.Parse(number.Value); + + public static implicit operator long(JsonNumber number) + => long.Parse(number.value); + + public static implicit operator UInt16(JsonNumber number) + => ushort.Parse(number.Value); + + public static implicit operator UInt32(JsonNumber number) + => uint.Parse(number.Value); + + public static implicit operator UInt64(JsonNumber number) + => ulong.Parse(number.Value); + + public static implicit operator decimal(JsonNumber number) + => decimal.Parse(number.Value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator Double(JsonNumber number) + => double.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator float(JsonNumber number) + => float.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator JsonNumber(short data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(int data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(long data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(Single data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(double data) + => new JsonNumber(data.ToString()); + + #endregion + + public override string ToString() => value; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonObject.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..e106425dd549 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonObject.cs @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public partial class JsonObject : JsonNode, IDictionary + { + private readonly Dictionary items; + + internal JsonObject() + { + items = new Dictionary(); + } + + internal JsonObject(IEnumerable> properties) + { + if (properties == null) throw new ArgumentNullException(nameof(properties)); + + items = new Dictionary(); + + foreach (var field in properties) + { + items.Add(field.Key, field.Value); + } + } + + #region IDictionary Constructors + + internal JsonObject(IDictionary dic) + { + items = new Dictionary(dic.Count); + + foreach (var pair in dic) + { + Add(pair.Key, pair.Value); + } + } + + #endregion + + internal override JsonType Type => JsonType.Object; + + #region Add Overloads + + public void Add(string name, JsonNode value) => + items.Add(name, value); + + public void Add(string name, byte[] value) => + items.Add(name, new XBinary(value)); + + public void Add(string name, DateTime value) => + items.Add(name, new JsonDate(value)); + + public void Add(string name, int value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, long value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, float value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, double value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, string value) => + items.Add(name, new JsonString(value)); + + public void Add(string name, bool value) => + items.Add(name, new JsonBoolean(value)); + + public void Add(string name, Uri url) => + items.Add(name, new JsonString(url.AbsoluteUri)); + + public void Add(string name, string[] values) => + items.Add(name, new XImmutableArray(values)); + + public void Add(string name, int[] values) => + items.Add(name, new XImmutableArray(values)); + + #endregion + + #region ICollection> Members + + void ICollection>.Add(KeyValuePair item) + { + items.Add(item.Key, item.Value); + } + + void ICollection>.Clear() + { + items.Clear(); + } + + bool ICollection>.Contains(KeyValuePair item) => + throw new NotImplementedException(); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) => + throw new NotImplementedException(); + + + int ICollection>.Count => items.Count; + + bool ICollection>.IsReadOnly => false; + + bool ICollection>.Remove(KeyValuePair item) => + throw new NotImplementedException(); + + #endregion + + #region IDictionary Members + + public bool ContainsKey(string key) => items.ContainsKey(key); + + public ICollection Keys => items.Keys; + + public bool Remove(string key) => items.Remove(key); + + public bool TryGetValue(string key, out JsonNode value) => + items.TryGetValue(key, out value); + + public ICollection Values => items.Values; + + public override JsonNode this[string key] + { + get => items[key]; + set => items[key] = value; + } + + #endregion + + #region IEnumerable + + IEnumerator> IEnumerable>.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + + #region Helpers + + internal static new JsonObject FromObject(object instance) => + (JsonObject)new JsonSerializer().Serialize(instance); + + #endregion + + #region Static Constructors + + internal static JsonObject FromStream(Stream stream) + { + using (var tr = new StreamReader(stream)) + { + return (JsonObject)Parse(tr); + } + } + + internal static new JsonObject Parse(string text) + { + return (JsonObject)JsonNode.Parse(text); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonString.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..1de1f24d2e8a --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/JsonString.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed partial class JsonString : JsonNode, IEquatable + { + private readonly string value; + + internal JsonString(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal override JsonType Type => JsonType.String; + + internal string Value => value; + + internal int Length => value.Length; + + #region #region Implicit Casts + + public static implicit operator string(JsonString data) => data.Value; + + public static implicit operator JsonString(string value) => new JsonString(value); + + #endregion + + public override int GetHashCode() => value.GetHashCode(); + + public override string ToString() => value; + + #region IEquatable + + bool IEquatable.Equals(JsonString other) => this.Value == other.Value; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/XBinary.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..b8a6b6d24f9b --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/XBinary.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal sealed class XBinary : JsonNode + { + private readonly byte[] _value; + private readonly string _base64; + + internal XBinary(byte[] value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal XBinary(string base64EncodedString) + { + _base64 = base64EncodedString ?? throw new ArgumentNullException(nameof(base64EncodedString)); + } + + internal override JsonType Type => JsonType.Binary; + + internal byte[] Value => _value ?? Convert.FromBase64String(_base64); + + #region #region Implicit Casts + + public static implicit operator byte[] (XBinary data) => data.Value; + + public static implicit operator XBinary(byte[] data) => new XBinary(data); + + #endregion + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => _base64 ?? Convert.ToBase64String(_value); + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/XNull.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..a507ac951117 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Nodes/XNull.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal sealed class XNull : JsonNode + { + internal static readonly XNull Instance = new XNull(); + + private XNull() { } + + internal override JsonType Type => JsonType.Null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..5bc9c4b662db --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/Exceptions/ParseException.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. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal class ParserException : Exception + { + internal ParserException(string message) + : base(message) + { } + + internal ParserException(string message, SourceLocation location) + : base(message) + { + + Location = location; + } + + internal SourceLocation Location { get; } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonParser.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..4495d790d22c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonParser.cs @@ -0,0 +1,180 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public class JsonParser : IDisposable + { + private readonly TokenReader reader; + + internal JsonParser(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonParser(SourceReader sourceReader) + { + if (sourceReader == null) + throw new ArgumentNullException(nameof(sourceReader)); + + this.reader = new TokenReader(new JsonTokenizer(sourceReader)); + + this.reader.Next(); // Start with the first token + } + + internal IEnumerable ReadNodes() + { + JsonNode node; + + while ((node = ReadNode()) != null) yield return node; + } + + internal JsonNode ReadNode() + { + if (reader.Current.Kind == TokenKind.Eof || reader.Current.IsTerminator) + { + return null; + } + + switch (reader.Current.Kind) + { + case TokenKind.LeftBrace : return ReadObject(); // { + case TokenKind.LeftBracket : return ReadArray(); // [ + + default: throw new ParserException($"Expected '{{' or '['. Was {reader.Current}."); + } + } + + private JsonNode ReadFieldValue() + { + // Boolean, Date, Null, Number, String, Uri + if (reader.Current.IsLiteral) + { + return ReadLiteral(); + } + else + { + switch (reader.Current.Kind) + { + case TokenKind.LeftBracket: return ReadArray(); + case TokenKind.LeftBrace : return ReadObject(); + + default: throw new ParserException($"Unexpected token reading field value. Was {reader.Current}."); + } + } + } + + private JsonNode ReadLiteral() + { + var literal = reader.Current; + + reader.Next(); // Read the literal token + + switch (literal.Kind) + { + case TokenKind.Boolean : return JsonBoolean.Parse(literal.Value); + case TokenKind.Null : return XNull.Instance; + case TokenKind.Number : return new JsonNumber(literal.Value); + case TokenKind.String : return new JsonString(literal.Value); + + default: throw new ParserException($"Unexpected token reading literal. Was {literal}."); + } + } + + internal JsonObject ReadObject() + { + reader.Ensure(TokenKind.LeftBrace, "object"); + + reader.Next(); // Read '{' (Object start) + + var jsonObject = new JsonObject(); + + // Read the object's fields until we reach the end of the object ('}') + while (reader.Current.Kind != TokenKind.RightBrace) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read ',' (Seperator) + } + + // Ensure we have a field name + reader.Ensure(TokenKind.String, "Expected field name"); + + var field = ReadField(); + + jsonObject.Add(field.Key, field.Value); + } + + reader.Next(); // Read '}' (Object end) + + return jsonObject; + } + + + // TODO: Use ValueTuple in C#7 + private KeyValuePair ReadField() + { + var fieldName = reader.Current.Value; + + reader.Next(); // Read the field name + + reader.Ensure(TokenKind.Colon, "field"); + + reader.Next(); // Read ':' (Field value indicator) + + return new KeyValuePair(fieldName, ReadFieldValue()); + } + + + internal JsonArray ReadArray() + { + reader.Ensure(TokenKind.LeftBracket, "array"); + + var array = new XNodeArray(); + + reader.Next(); // Read the '[' (Array start) + + // Read the array's items + while (reader.Current.Kind != TokenKind.RightBracket) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read the ',' (Seperator) + } + + if (reader.Current.IsLiteral) + { + array.Add(ReadLiteral()); // Boolean, Date, Number, Null, String, Uri + } + else if (reader.Current.Kind == TokenKind.LeftBracket) + { + array.Add(ReadArray()); // Array + } + else if (reader.Current.Kind == TokenKind.LeftBrace) + { + array.Add(ReadObject()); // Object + } + else + { + throw new ParserException($"Expected comma, literal, or object. Was {reader.Current}."); + } + } + + reader.Next(); // Read the ']' (Array end) + + return array; + } + + #region IDisposable + + public void Dispose() + { + reader.Dispose(); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonToken.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..cf962a2c17c6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonToken.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. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal enum TokenKind + { + LeftBrace, // { Object start + RightBrace, // } Object end + + LeftBracket, // [ Array start + RightBracket, // ] Array end + + Comma, // , Comma + Colon, // : Value indicator + Dot, // . Access field indicator + Terminator, // \0 Stream terminator + + Boolean = 31, // true or false + Null = 33, // null + Number = 34, // i.e. -1.93, -1, 0, 1, 1.1 + String = 35, // i.e. "text" + + Eof = 50 + } + + internal /* readonly */ struct JsonToken + { + internal static readonly JsonToken BraceOpen = new JsonToken(TokenKind.LeftBrace, "{"); + internal static readonly JsonToken BraceClose = new JsonToken(TokenKind.RightBrace, "}"); + + internal static readonly JsonToken BracketOpen = new JsonToken(TokenKind.LeftBracket, "["); + internal static readonly JsonToken BracketClose = new JsonToken(TokenKind.RightBracket, "]"); + + internal static readonly JsonToken Colon = new JsonToken(TokenKind.Colon, ":"); + internal static readonly JsonToken Comma = new JsonToken(TokenKind.Comma, ","); + internal static readonly JsonToken Terminator = new JsonToken(TokenKind.Terminator, "\0"); + + internal static readonly JsonToken True = new JsonToken(TokenKind.Boolean, "true"); + internal static readonly JsonToken False = new JsonToken(TokenKind.Boolean, "false"); + internal static readonly JsonToken Null = new JsonToken(TokenKind.Null, "null"); + + internal static readonly JsonToken Eof = new JsonToken(TokenKind.Eof, null); + + internal JsonToken(TokenKind kind, string value) + { + Kind = kind; + Value = value; + } + + internal readonly TokenKind Kind; + + internal readonly string Value; + + public override string ToString() => Kind + ": " + Value; + + #region Helpers + + internal bool IsLiteral => (byte)Kind > 30 && (byte)Kind < 40; + + internal bool IsTerminator => Kind == TokenKind.Terminator; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..bec239ef1856 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/JsonTokenizer.cs @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + using System.IO; + + + public class JsonTokenizer : IDisposable + { + private readonly StringBuilder sb = new StringBuilder(); + + private readonly SourceReader reader; + + internal JsonTokenizer(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonTokenizer(SourceReader reader) + { + this.reader = reader; + + reader.Next(); // Start with the first char + } + + internal JsonToken ReadNext() + { + reader.SkipWhitespace(); + + if (reader.IsEof) return JsonToken.Eof; + + switch (reader.Current) + { + case '"': return ReadQuotedString(); + + // Symbols + case '[' : reader.Next(); return JsonToken.BracketOpen; // Array start + case ']' : reader.Next(); return JsonToken.BracketClose; // Array end + case ',' : reader.Next(); return JsonToken.Comma; // Value seperator + case ':' : reader.Next(); return JsonToken.Colon; // Field value indicator + case '{' : reader.Next(); return JsonToken.BraceOpen; // Object start + case '}' : reader.Next(); return JsonToken.BraceClose; // Object end + case '\0' : reader.Next(); return JsonToken.Terminator; // Stream terminiator + + default: return ReadLiteral(); + } + } + + private JsonToken ReadQuotedString() + { + Expect('"', "quoted string indicator"); + + reader.Next(); // Read '"' (Starting quote) + + // Read until we reach an unescaped quote char + while (reader.Current != '"') + { + EnsureNotEof("quoted string"); + + if (reader.Current == '\\') + { + char escapedCharacter = reader.ReadEscapeCode(); + + sb.Append(escapedCharacter); + + continue; + } + + StoreCurrentCharacterAndReadNext(); + } + + reader.Next(); // Read '"' (Ending quote) + + return new JsonToken(TokenKind.String, value: sb.Extract()); + } + + private JsonToken ReadLiteral() + { + if (char.IsDigit(reader.Current) || + reader.Current == '-' || + reader.Current == '+') + { + return ReadNumber(); + } + + return ReadIdentifer(); + } + + private JsonToken ReadNumber() + { + // Read until we hit a non-numeric character + // -6.247737e-06 + // E + + while (char.IsDigit(reader.Current) + || reader.Current == '.' + || reader.Current == 'e' + || reader.Current == 'E' + || reader.Current == '-' + || reader.Current == '+') + { + StoreCurrentCharacterAndReadNext(); + } + + return new JsonToken(TokenKind.Number, value: sb.Extract()); + } + + int count = 0; + + private JsonToken ReadIdentifer() + { + count++; + + if (!char.IsLetter(reader.Current)) + { + throw new ParserException( + message : $"Expected literal (number, boolean, or null). Was '{reader.Current}'.", + location : reader.Location + ); + } + + // Read letters, numbers, and underscores '_' + while (char.IsLetterOrDigit(reader.Current) || reader.Current == '_') + { + StoreCurrentCharacterAndReadNext(); + } + + string text = sb.Extract(); + + switch (text) + { + case "true": return JsonToken.True; + case "false": return JsonToken.False; + case "null": return JsonToken.Null; + + default: return new JsonToken(TokenKind.String, text); + } + } + + private void Expect(char character, string description) + { + if (reader.Current != character) + { + throw new ParserException( + message: $"Expected {description} ('{character}'). Was '{reader.Current}'.", + location: reader.Location + ); + } + } + + private void EnsureNotEof(string tokenType) + { + if (reader.IsEof) + { + throw new ParserException( + message: $"Unexpected EOF while reading {tokenType}.", + location: reader.Location + ); + } + } + + private void StoreCurrentCharacterAndReadNext() + { + sb.Append(reader.Current); + + reader.Next(); + } + + public void Dispose() + { + reader.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Parser/Location.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..0ef605d22fb3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/Location.cs @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal struct SourceLocation + { + private int line; + private int column; + private int position; + + internal SourceLocation(int line = 0, int column = 0, int position = 0) + { + this.line = line; + this.column = column; + this.position = position; + } + + internal int Line => line; + + internal int Column => column; + + internal int Position => position; + + internal void Advance() + { + this.column++; + this.position++; + } + + internal void MarkNewLine() + { + this.line++; + this.column = 0; + } + + internal SourceLocation Clone() + { + return new SourceLocation(line, column, position); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..8a06d50e9d0e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/Readers/SourceReader.cs @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Globalization; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public sealed class SourceReader : IDisposable + { + private readonly TextReader source; + + private char current; + + private readonly SourceLocation location = new SourceLocation(); + + private bool isEof = false; + + internal SourceReader(TextReader textReader) + { + this.source = textReader ?? throw new ArgumentNullException(nameof(textReader)); + } + + /// + /// Advances to the next character + /// + internal void Next() + { + // Advance to the new line when we see a new line '\n'. + // A new line may be prefixed by a carriage return '\r'. + + if (current == '\n') + { + location.MarkNewLine(); + } + + int charCode = source.Read(); // -1 for end + + if (charCode >= 0) + { + current = (char)charCode; + } + else + { + // If we've already marked this as the EOF, throw an exception + if (isEof) + { + throw new EndOfStreamException("Cannot advance past end of stream."); + } + + isEof = true; + + current = '\0'; + } + + location.Advance(); + } + + internal void SkipWhitespace() + { + while (char.IsWhiteSpace(current)) + { + Next(); + } + } + + internal char ReadEscapeCode() + { + Next(); + + char escapedChar = current; + + Next(); // Consume escaped character + + switch (escapedChar) + { + // Special escape codes + case '"': return '"'; // " (Quotation mark) U+0022 + case '/': return '/'; // / (Solidus) U+002F + case '\\': return '\\'; // \ (Reverse solidus) U+005C + + // Control Characters + case '0': return '\0'; // Nul (0) U+0000 + case 'a': return '\a'; // Alert (7) + case 'b': return '\b'; // Backspace (8) U+0008 + case 'f': return '\f'; // Form feed (12) U+000C + case 'n': return '\n'; // Line feed (10) U+000A + case 'r': return '\r'; // Carriage return (13) U+000D + case 't': return '\t'; // Horizontal tab (9) U+0009 + case 'v': return '\v'; // Vertical tab + + // Unicode escape sequence + case 'u': return ReadUnicodeEscapeSequence(); // U+XXXX + + default: throw new Exception($"Unrecognized escape sequence '\\{escapedChar}'"); + } + } + + private readonly char[] hexCode = new char[4]; + + private char ReadUnicodeEscapeSequence() + { + hexCode[0] = current; Next(); + hexCode[1] = current; Next(); + hexCode[2] = current; Next(); + hexCode[3] = current; Next(); + + return Convert.ToChar(int.Parse( + s : new string(hexCode), + style : NumberStyles.HexNumber, + provider: NumberFormatInfo.InvariantInfo + )); + } + + internal char Current => current; + + internal bool IsEof => isEof; + + internal char Peek() => (char)source.Peek(); + + internal SourceLocation Location => location; + + public void Dispose() + { + source.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Parser/TokenReader.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..675c919f720e --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Parser/TokenReader.cs @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + public class TokenReader : IDisposable + { + private readonly JsonTokenizer tokenizer; + private JsonToken current; + + internal TokenReader(JsonTokenizer tokenizer) + { + this.tokenizer = tokenizer ?? throw new ArgumentNullException(nameof(tokenizer)); + } + + internal void Next() + { + current = tokenizer.ReadNext(); + } + + internal JsonToken Current => current; + + internal void Ensure(TokenKind kind, string readerName) + { + if (current.Kind != kind) + { + throw new ParserException($"Expected {kind} while reading {readerName}). Was {current}."); + } + } + + public void Dispose() + { + tokenizer.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/PipelineMocking.cs b/swaggerci/recoveryservicesbackup/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..192c3a43a090 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/PipelineMocking.cs @@ -0,0 +1,262 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using System.Threading.Tasks; + using System.Collections.Generic; + using System.Net.Http; + using System.Linq; + using System.Net; + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json; + + public enum MockMode + { + Live, + Record, + Playback, + + } + + public class PipelineMock + { + + private System.Collections.Generic.Stack scenario = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack context = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack description = new System.Collections.Generic.Stack(); + + private readonly string recordingPath; + private int counter = 0; + + public static implicit operator Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep(PipelineMock instance) => instance.SendAsync; + + public MockMode Mode { get; set; } = MockMode.Live; + public PipelineMock(string recordingPath) + { + this.recordingPath = recordingPath; + } + + public void PushContext(string text) => context.Push(text); + + public void PushDescription(string text) => description.Push(text); + + + public void PushScenario(string it) + { + // reset counter too + counter = 0; + + scenario.Push(it); + } + + public void PopContext() => context.Pop(); + + public void PopDescription() => description.Pop(); + + public void PopScenario() => scenario.Pop(); + + public void SetRecord() => Mode = MockMode.Record; + + public void SetPlayback() => Mode = MockMode.Playback; + + public void SetLive() => Mode = MockMode.Live; + + public string Scenario => (scenario.Count > 0 ? scenario.Peek() : "[NoScenario]"); + public string Description => (description.Count > 0 ? description.Peek() : "[NoDescription]"); + public string Context => (context.Count > 0 ? context.Peek() : "[NoContext]"); + + /// + /// Headers that we substitute out blank values for in the recordings + /// Add additional headers as necessary + /// + public static HashSet Blacklist = new HashSet(System.StringComparer.CurrentCultureIgnoreCase) { + "Authorization", + }; + + public Dictionary ForceResponseHeaders = new Dictionary(); + + internal static XImmutableArray Removed = new XImmutableArray(new string[] { "[Filtered]" }); + + internal static IEnumerable> FilterHeaders(IEnumerable>> headers) => headers.Select(header => new KeyValuePair(header.Key, Blacklist.Contains(header.Key) ? Removed : new XImmutableArray(header.Value.ToArray()))); + + internal static JsonNode SerializeContent(HttpContent content, ref bool isBase64) => content == null ? XNull.Instance : SerializeContent(content.ReadAsByteArrayAsync().Result, ref isBase64); + + internal static JsonNode SerializeContent(byte[] content, ref bool isBase64) + { + if (null == content || content.Length == 0) + { + return XNull.Instance; + } + var first = content[0]; + var last = content[content.Length - 1]; + + // plaintext for JSON/SGML/XML/HTML/STRINGS/ARRAYS + if ((first == '{' && last == '}') || (first == '<' && last == '>') || (first == '[' && last == ']') || (first == '"' && last == '"')) + { + return new JsonString(System.Text.Encoding.UTF8.GetString(content)); + } + + // base64 for everyone else + return new JsonString(System.Convert.ToBase64String(content)); + } + + internal static byte[] DeserializeContent(string content, bool isBase64) + { + if (string.IsNullOrWhiteSpace(content)) + { + return new byte[0]; + } + + if (isBase64) + { + try + { + return System.Convert.FromBase64String(content); + } + catch + { + // hmm. didn't work, return it as a string I guess. + } + } + return System.Text.Encoding.UTF8.GetBytes(content); + } + + public void SaveMessage(string rqKey, HttpRequestMessage request, HttpResponseMessage response) + { + var messages = System.IO.File.Exists(this.recordingPath) ? Load() : new JsonObject() ?? new JsonObject(); + bool isBase64Request = false; + bool isBase64Response = false; + messages[rqKey] = new JsonObject { + { "Request",new JsonObject { + { "Method", request.Method.Method }, + { "RequestUri", request.RequestUri }, + { "Content", SerializeContent( request.Content, ref isBase64Request) }, + { "isContentBase64", isBase64Request }, + { "Headers", new JsonObject(FilterHeaders(request.Headers)) }, + { "ContentHeaders", request.Content == null ? new JsonObject() : new JsonObject(FilterHeaders(request.Content.Headers))} + } }, + {"Response", new JsonObject { + { "StatusCode", (int)response.StatusCode}, + { "Headers", new JsonObject(FilterHeaders(response.Headers))}, + { "ContentHeaders", new JsonObject(FilterHeaders(response.Content.Headers))}, + { "Content", SerializeContent(response.Content, ref isBase64Response) }, + { "isContentBase64", isBase64Response }, + }} + }; + System.IO.File.WriteAllText(this.recordingPath, messages.ToString()); + } + + private JsonObject Load() + { + if (System.IO.File.Exists(this.recordingPath)) + { + try + { + return JsonObject.FromStream(System.IO.File.OpenRead(this.recordingPath)); + } + catch + { + throw new System.Exception($"Invalid recording file: '{recordingPath}'"); + } + } + + throw new System.ArgumentException($"Missing recording file: '{recordingPath}'", nameof(recordingPath)); + } + + public HttpResponseMessage LoadMessage(string rqKey) + { + var responses = Load(); + var message = responses.Property(rqKey); + + if (null == message) + { + throw new System.ArgumentException($"Missing Request '{rqKey}' in recording file", nameof(rqKey)); + } + + var sc = 0; + var reqMessage = message.Property("Request"); + var respMessage = message.Property("Response"); + + // --------------------------- deserialize response ---------------------------------------------------------------- + bool isBase64Response = false; + respMessage.BooleanProperty("isContentBase64", ref isBase64Response); + var response = new HttpResponseMessage + { + StatusCode = (HttpStatusCode)respMessage.NumberProperty("StatusCode", ref sc), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(respMessage.StringProperty("Content"), isBase64Response)) + }; + + foreach (var each in respMessage.Property("Headers")) + { + response.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + foreach (var frh in ForceResponseHeaders) + { + response.Headers.Remove(frh.Key); + response.Headers.TryAddWithoutValidation(frh.Key, frh.Value); + } + + foreach (var each in respMessage.Property("ContentHeaders")) + { + response.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + // --------------------------- deserialize request ---------------------------------------------------------------- + bool isBase64Request = false; + reqMessage.BooleanProperty("isContentBase64", ref isBase64Request); + response.RequestMessage = new HttpRequestMessage + { + Method = new HttpMethod(reqMessage.StringProperty("Method")), + RequestUri = new System.Uri(reqMessage.StringProperty("RequestUri")), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(reqMessage.StringProperty("Content"), isBase64Request)) + }; + + foreach (var each in reqMessage.Property("Headers")) + { + response.RequestMessage.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + foreach (var each in reqMessage.Property("ContentHeaders")) + { + response.RequestMessage.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + return response; + } + + public async Task SendAsync(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + counter++; + var rqkey = $"{Description}+{Context}+{Scenario}+${request.Method.Method}+{request.RequestUri}+{counter}"; + + switch (Mode) + { + case MockMode.Record: + //Add following code since the request.Content will be released after sendAsync + var requestClone = request; + if (requestClone.Content != null) + { + requestClone = await request.CloneWithContent(request.RequestUri, request.Method); + } + // make the call + var response = await next.SendAsync(request, callback); + + // save the message to the recording file + SaveMessage(rqkey, requestClone, response); + + // return the response. + return response; + + case MockMode.Playback: + // load and return the response. + return LoadMessage(rqkey); + + default: + // pass-thru, do nothing + return await next.SendAsync(request, callback); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Response.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Response.cs new file mode 100644 index 000000000000..42d900455d71 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Response.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. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using System; + using System.Threading.Tasks; + public class Response : EventData + { + public Response() : base() + { + } + } + + public class Response : Response + { + private Func> _resultDelegate; + private Task _resultValue; + + public Response(T value) : base() => _resultValue = Task.FromResult(value); + public Response(Func value) : base() => _resultDelegate = () => Task.FromResult(value()); + public Response(Func> value) : base() => _resultDelegate = value; + public Task Result => _resultValue ?? (_resultValue = this._resultDelegate()); + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..00a6dd9483c6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Serialization/JsonSerializer.cs @@ -0,0 +1,350 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal class JsonSerializer + { + private int depth = 0; + + private SerializationOptions options = new SerializationOptions(); + + #region Deserialization + + internal T Deseralize(JsonObject json) + where T : new() + { + var contract = JsonModelCache.Get(typeof(T)); + + return (T)DeserializeObject(contract, json); + } + + internal object DeserializeObject(JsonModel contract, JsonObject json) + { + var instance = Activator.CreateInstance(contract.Type); + + depth++; + + // Ensure we don't recurse forever + if (depth > 5) throw new Exception("Depth greater than 5"); + + foreach (var field in json) + { + var member = contract[field.Key]; + + if (member != null) + { + var value = DeserializeValue(member, field.Value); + + member.SetValue(instance, value); + } + } + + depth--; + + return instance; + } + + private object DeserializeValue(JsonMember member, JsonNode value) + { + if (value.Type == JsonType.Null) return null; + + var type = member.Type; + + if (member.IsStringLike && value.Type != JsonType.String) + { + // Take the long path... + return DeserializeObject(JsonModelCache.Get(type), (JsonObject)value); + } + else if (member.Converter != null) + { + return member.Converter.FromJson(value); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (member.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + private object DeserializeValue(Type type, JsonNode value) + { + if (type == null) throw new ArgumentNullException(nameof(type)); + + if (value.Type == JsonType.Null) return null; + + var typeDetails = TypeDetails.Get(type); + + if (typeDetails.JsonConverter != null) + { + return typeDetails.JsonConverter.FromJson(value); + } + else if (typeDetails.IsEnum) + { + return Enum.Parse(type, value.ToString(), ignoreCase: true); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (typeDetails.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + internal Array DeserializeArray(Type type, JsonArray elements) + { + var elementType = type.GetElementType(); + + var elementTypeDetails = TypeDetails.Get(elementType); + + var array = Array.CreateInstance(elementType, elements.Count); + + int i = 0; + + if (elementTypeDetails.JsonConverter != null) + { + foreach (var value in elements) + { + array.SetValue(elementTypeDetails.JsonConverter.FromJson(value), i); + + i++; + } + } + else + { + foreach (var value in elements) + { + array.SetValue(DeserializeValue(elementType, value), i); + + i++; + } + } + + return array; + } + + internal IList DeserializeList(Type type, JsonArray jsonArray) + { + // TODO: Handle non-generic types + if (!type.IsGenericType) + throw new ArgumentException("Must be a generic type", nameof(type)); + + var elementType = type.GetGenericArguments()[0]; + + IList list; + + if (type.IsInterface) + { + // Create a concrete generic list + list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(elementType)); + } + else + { + list = (IList)Activator.CreateInstance(type); + } + + foreach (var value in jsonArray) + { + list.Add(DeserializeValue(elementType, value)); + } + + return list; + } + + #endregion + + #region Serialization + + internal JsonNode Serialize(object instance) => + Serialize(instance, SerializationOptions.Default); + + internal JsonNode Serialize(object instance, string[] include) => + Serialize(instance, new SerializationOptions { Include = include }); + + internal JsonNode Serialize(object instance, SerializationOptions options) + { + this.options = options; + + if (instance == null) + { + return XNull.Instance; + } + + return ReadValue(instance.GetType(), instance); + } + + #region Readers + + internal JsonArray ReadArray(IEnumerable collection) + { + var array = new XNodeArray(); + + foreach (var item in collection) + { + array.Add(ReadValue(item.GetType(), item)); + } + + return array; + } + + internal IEnumerable> ReadProperties(object instance) + { + var contract = JsonModelCache.Get(instance.GetType()); + + foreach (var member in contract.Members) + { + string name = member.Name; + + if (options.PropertyNameTransformer != null) + { + name = options.PropertyNameTransformer.Invoke(name); + } + + // Skip the field if it's not included + if ((depth == 1 && !options.IsIncluded(name))) + { + continue; + } + + var value = member.GetValue(instance); + + if (!member.EmitDefaultValue && (value == null || (member.IsList && ((IList)value).Count == 0) || value.Equals(member.DefaultValue))) + { + continue; + } + else if (options.IgnoreNullValues && value == null) // Ignore null values + { + continue; + } + + // Transform the value if there is one + if (options.Transformations != null) + { + var transform = options.GetTransformation(name); + + if (transform != null) + { + value = transform.Transformer(value); + } + } + + yield return new KeyValuePair(name, ReadValue(member.TypeDetails, value)); + } + } + + private JsonObject ReadObject(object instance) + { + depth++; + + // TODO: Guard against a self referencing graph + if (depth > options.MaxDepth) + { + depth--; + + return new JsonObject(); + } + + var node = new JsonObject(ReadProperties(instance)); + + depth--; + + return node; + } + + private JsonNode ReadValue(Type type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + var member = TypeDetails.Get(type); + + return ReadValue(member, value); + } + + private JsonNode ReadValue(TypeDetails type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + if (type.JsonConverter != null) + { + return type.JsonConverter.ToJson(value); + } + else if (type.IsArray) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateArray((string[])value); + case TypeCode.UInt16: return CreateArray((ushort[])value); + case TypeCode.UInt32: return CreateArray((uint[])value); + case TypeCode.UInt64: return CreateArray((ulong[])value); + case TypeCode.Int16: return CreateArray((short[])value); + case TypeCode.Int32: return CreateArray((int[])value); + case TypeCode.Int64: return CreateArray((long[])value); + case TypeCode.Single: return CreateArray((float[])value); + case TypeCode.Double: return CreateArray((double[])value); + default: return ReadArray((IEnumerable)value); + } + } + else if (value is IEnumerable) + { + if (type.IsList && type.ElementType != null) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateList(value); + case TypeCode.UInt16: return CreateList(value); + case TypeCode.UInt32: return CreateList(value); + case TypeCode.UInt64: return CreateList(value); + case TypeCode.Int16: return CreateList(value); + case TypeCode.Int32: return CreateList(value); + case TypeCode.Int64: return CreateList(value); + case TypeCode.Single: return CreateList(value); + case TypeCode.Double: return CreateList(value); + } + } + + return ReadArray((IEnumerable)value); + } + else + { + // Complex object + return ReadObject(value); + } + } + + private XList CreateList(object value) => new XList((IList)value); + + private XImmutableArray CreateArray(T[] array) => new XImmutableArray(array); + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..f6e68422cf97 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Serialization/PropertyTransformation.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal class PropertyTransformation + { + internal PropertyTransformation(string name, Func transformer) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Transformer = transformer ?? throw new ArgumentNullException(nameof(transformer)); + } + + internal string Name { get; } + + internal Func Transformer { get; } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..14c0257cace1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Serialization/SerializationOptions.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal class SerializationOptions + { + internal static readonly SerializationOptions Default = new SerializationOptions(); + + internal SerializationOptions() { } + + internal SerializationOptions( + string[] include = null, + bool ingoreNullValues = false) + { + Include = include; + IgnoreNullValues = ingoreNullValues; + } + + internal string[] Include { get; set; } + + internal string[] Exclude { get; set; } + + internal bool IgnoreNullValues { get; set; } + + internal PropertyTransformation[] Transformations { get; set; } + + internal Func PropertyNameTransformer { get; set; } + + internal int MaxDepth { get; set; } = 5; + + internal bool IsIncluded(string name) + { + if (Exclude != null) + { + return !Exclude.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + else if (Include != null) + { + return Include.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + + return true; + } + + internal PropertyTransformation GetTransformation(string propertyName) + { + if (Transformations == null) return null; + + foreach (var t in Transformations) + { + if (t.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) + { + return t; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/SerializationMode.cs b/swaggerci/recoveryservicesbackup/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..5e82a363a8eb --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/SerializationMode.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + [System.Flags] + public enum SerializationMode + { + None = 0, + IncludeHeaders = 1 << 0, + IncludeReadOnly = 1 << 1, + + IncludeAll = IncludeHeaders | IncludeReadOnly + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/UndeclaredResponseException.cs b/swaggerci/recoveryservicesbackup/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..7b6cc3ef1a7c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/UndeclaredResponseException.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. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public class RestException : Exception, IDisposable + { + public System.Net.HttpStatusCode StatusCode { get; set; } + public string Code { get; protected set; } + protected string message; + public HttpRequestMessage RequestMessage { get; protected set; } + public HttpResponseHeaders ResponseHeaders { get; protected set; } + + public string ResponseBody { get; protected set; } + public string ClientRequestId { get; protected set; } + public string RequestId { get; protected set; } + + public override string Message => message; + public string Action { get; protected set; } + + public RestException(System.Net.Http.HttpResponseMessage response) + { + StatusCode = response.StatusCode; + //CloneWithContent will not work here since the content is disposed after sendAsync + //Besides, it seems there is no need for the request content cloned here. + RequestMessage = response.RequestMessage.Clone(); + ResponseBody = response.Content.ReadAsStringAsync().Result; + ResponseHeaders = response.Headers; + + RequestId = response.GetFirstHeader("x-ms-request-id"); + ClientRequestId = response.GetFirstHeader("x-ms-client-request-id"); + + try + { + // try to parse the body as JSON, and see if a code and message are in there. + var json = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(ResponseBody) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject; + + // error message could be in properties.statusMessage + { message = If(json?.Property("properties"), out var p) + && If(p?.PropertyT("statusMessage"), out var sm) + ? (string)sm : (string)Message; } + + // see if there is an error block in the body + json = json?.Property("error") ?? json; + + { Code = If(json?.PropertyT("code"), out var c) ? (string)c : (string)StatusCode.ToString(); } + { message = If(json?.PropertyT("message"), out var m) ? (string)m : (string)Message; } + { Action = If(json?.PropertyT("action"), out var a) ? (string)a : (string)Action; } + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // couldn't get the code/message from the body response. + // In this case, we will assume the response is the expected error message + if(!string.IsNullOrEmpty(ResponseBody)) { + message = ResponseBody; + } + } +#endif + if (string.IsNullOrEmpty(message)) + { + if (StatusCode >= System.Net.HttpStatusCode.BadRequest && StatusCode < System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Request Error, Status: {StatusCode}"; + } + else if (StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Server Error, Status: {StatusCode}"; + } + else + { + message = $"The server responded with an unrecognized response, Status: {StatusCode}"; + } + } + } + + public void Dispose() + { + ((IDisposable)RequestMessage).Dispose(); + } + } + + public class RestException : RestException + { + public T Error { get; protected set; } + public RestException(System.Net.Http.HttpResponseMessage response, T error) : base(response) + { + Error = error; + } + } + + + public class UndeclaredResponseException : RestException + { + public UndeclaredResponseException(System.Net.Http.HttpResponseMessage response) : base(response) + { + + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/Writers/JsonWriter.cs b/swaggerci/recoveryservicesbackup/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..b5cfba60f69c --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/Writers/JsonWriter.cs @@ -0,0 +1,223 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Web; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json +{ + internal class JsonWriter + { + const string indentation = " "; // 2 spaces + + private readonly bool pretty; + private readonly TextWriter writer; + + protected int currentLevel = 0; + + internal JsonWriter(TextWriter writer, bool pretty = true) + { + this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); + this.pretty = pretty; + } + + internal void WriteNode(JsonNode node) + { + switch (node.Type) + { + case JsonType.Array: WriteArray((IEnumerable)node); break; + case JsonType.Object: WriteObject((JsonObject)node); break; + + // Primitives + case JsonType.Binary: WriteBinary((XBinary)node); break; + case JsonType.Boolean: WriteBoolean((bool)node); break; + case JsonType.Date: WriteDate((JsonDate)node); break; + case JsonType.Null: WriteNull(); break; + case JsonType.Number: WriteNumber((JsonNumber)node); break; + case JsonType.String: WriteString(node); break; + } + } + + internal void WriteArray(IEnumerable array) + { + currentLevel++; + + writer.Write('['); + + bool doIndentation = false; + + if (pretty) + { + foreach (var node in array) + { + if (node.Type == JsonType.Object || node.Type == JsonType.Array) + { + doIndentation = true; + + break; + } + } + } + + bool isFirst = true; + + foreach (JsonNode node in array) + { + if (!isFirst) writer.Write(','); + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + WriteNode(node); + + isFirst = false; + } + + currentLevel--; + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + writer.Write(']'); + } + + internal void WriteIndent() + { + if (pretty) + { + writer.Write(Environment.NewLine); + + for (int level = 0; level < currentLevel; level++) + { + writer.Write(indentation); + } + } + } + + internal void WriteObject(JsonObject obj) + { + currentLevel++; + + writer.Write('{'); + + bool isFirst = true; + + foreach (var field in obj) + { + if (!isFirst) writer.Write(','); + + WriteIndent(); + + WriteFieldName(field.Key); + + writer.Write(':'); + + if (pretty) + { + writer.Write(' '); + } + + // Write the field value + WriteNode(field.Value); + + isFirst = false; + } + + currentLevel--; + + WriteIndent(); + + writer.Write('}'); + } + + internal void WriteFieldName(string fieldName) + { + writer.Write('"'); + writer.Write(HttpUtility.JavaScriptStringEncode(fieldName)); + writer.Write('"'); + } + + #region Primitives + + internal void WriteBinary(XBinary value) + { + writer.Write('"'); + writer.Write(value.ToString()); + writer.Write('"'); + } + + internal void WriteBoolean(bool value) + { + writer.Write(value ? "true" : "false"); + } + + internal void WriteDate(JsonDate date) + { + if (date.ToDateTime().Year == 1) + { + WriteNull(); + } + else + { + writer.Write('"'); + writer.Write(date.ToIsoString()); + writer.Write('"'); + } + } + + internal void WriteNull() + { + writer.Write("null"); + } + + internal void WriteNumber(JsonNumber number) + { + if (number.Overflows) + { + writer.Write('"'); + writer.Write(number.Value); + writer.Write('"'); + } + else + { + writer.Write(number.Value); + } + } + + internal void WriteString(string text) + { + if (text == null) + { + WriteNull(); + } + else + { + writer.Write('"'); + + writer.Write(HttpUtility.JavaScriptStringEncode(text)); + + writer.Write('"'); + } + } + + #endregion + } +} + + +// TODO: Replace with System.Text.Json when available diff --git a/swaggerci/recoveryservicesbackup/generated/runtime/delegates.cs b/swaggerci/recoveryservicesbackup/generated/runtime/delegates.cs new file mode 100644 index 000000000000..0b328f813449 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/generated/runtime/delegates.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. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData=System.Func; + + public delegate Task SendAsync(HttpRequestMessage request, IEventListener callback); + public delegate Task SendAsyncStep(HttpRequestMessage request, IEventListener callback, ISendAsync next); + public delegate Task SignalEvent(string id, CancellationToken token, GetEventData getEventData); + public delegate Task Event(EventData message); + public delegate void SynchEvent(EventData message); + public delegate Task OnResponse(Response message); + public delegate Task OnResponse(Response message); +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup/readme.md b/swaggerci/recoveryservicesbackup/readme.md new file mode 100644 index 000000000000..c56fd5372945 --- /dev/null +++ b/swaggerci/recoveryservicesbackup/readme.md @@ -0,0 +1,10 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../tools/SwaggerCI/readme.azure.noprofile.md + - $(this-folder)/../../../azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md +try-require: + - $(this-folder)/../../../azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.powershell.md +```